Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substitutions not working #1361

Open
bramvbilsen opened this issue May 6, 2022 · 0 comments
Open

Substitutions not working #1361

bramvbilsen opened this issue May 6, 2022 · 0 comments

Comments

@bramvbilsen
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant