Nodejs - Sendgrid - Transactional Email

I am in the process of migrating my plain text transactional email to a templated one with substitution variables, but for some reason, despite following the with helper class example on their github repo, I receive an error that is saying the first instance in the personalization array is undefined. When I console log the mail variable to reveal the JSON, I am seeing all values come through as null which is weird because I haven't changed the structure of the code from when it worked in plain text with the exception of add the template id and substitution portion. Does anyone know what might be wrong here?

Side note: Function parameters (email, token, host) are coming through with the correct values when the function is triggered.

Here is the error:

[TypeError: Cannot read property '0' of undefined]

Here is my setup:

exports.userInvite = function(email, token, host){
    var fromEmail = new helper.Email('');
    var toEmail = new helper.Email(email);
    var subject = 'You Have Been Invited to Join My App';
    var registrationLink = 'https://' + host + '/sign-up/' + token;
    var mailSettings = new helper.MailSettings();
    var sandboxMode = new helper.SandBoxMode(true);

    var mail = new helper.Mail(fromEmail, subject, toEmail);


    //Add substitute variable to JSON
    mail.personalizations[0].addSubstitution(new helper.Substitution('%registration_link%', registrationLink));

    //Add email template id

    //Set mail settings

    var request = sg.emptyRequest({
        method: 'POST',
        path: '/v3/mail/send',
        body: mail.toJSON(),

    return sg.API(request, function(error, response) {