Skip to content

MailHelper.CreateSingleTemplateEmailToMultipleRecipients doesn't have a showAllRecipients param  #1055

Open

Description

@chris-hockeystickco

Hi,

This is similar to other issues on this board but this time, for templated emails. There is no option to get a single email with multiple TOs such that they can reply all successfully.

Is there a workaround and/or plan to add this option?

Using SendGrid 9.19.0
.Net Core 3.1.0

Regards

Chris

Activity

  1. eshanholtz commented on Oct 10, 2020

    @eshanholtz
    Contributor

    Hi @chris-hockeystickco

    We don't currently have a helper function for this exact use case, but there is a workaround. From the documentation, to send a single templated email to multiple To's in the same email, we need to make sure a single Personalization has an array of To's containing all of the recipients:

    var msg = new SendGridMessage();
    msg.SetFrom("notifications@company.com", "Sender");
    msg.AddTo("recipient1@example.com", "Recipient1");
    msg.AddTo("recipient2@example.com", "Recipient2");
    ...
    msg.SetGlobalSubject("subject");
    msg.SetTemplateId("<your template id string>");
    msg.SetTemplateData({...});

    Note that there are multiple AddTo/AddTos methods that you might find easier to use. What's important is that you want to make sure all recipients and the relevant template data on one email chain are located at the same personalization index.

    We do not currently have plans to add this specific helper, but I can mark this issue as a "community enhancement" and we will review any PRs submitted to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions