sendgrid-nodejs icon indicating copy to clipboard operation
sendgrid-nodejs copied to clipboard

Substitutions not working

Open bramvbilsen opened this issue 2 years ago • 0 comments

Issue Summary

Subsitution tags specified in the personalizations array are not being substituted using sendMultiple. Also, only the first object of personalizations is used, resulting in only a single email being sent instead of multiple.

Steps to Reproduce

  1. Send an email using sendMultiple including substitutions for each element in the personalizations field.
  2. Look at received email, the substitution tags are not replaced

Code Snippet

sendgrid.sendMultiple({
    personalizations: [
        {
            to: {
                email: "[email protected]",
                name: "John1",
            },
            substitutions: {
                "-name-": "John1",
            },
        },
        {
            to: {
                email: "[email protected]",
                name: "Bob",
            },
            substitutions: {
                "-name-": "Bob",
            },
        },
    ],
    from: {
        email: "[email protected]",
    },
    subject: "Welcome!",
    text: "Hi there -name- 👋",
});

Technical details:

  • sendgrid-nodejs version: ^7.6.2
  • node version: v16.13.2

bramvbilsen avatar May 06 '22 10:05 bramvbilsen