Skip to content

Using addTo sends a single mail with all email addresses inside the “to” #3

Description

@ahiyalala

What I thought when I was using the “to” method is that it will send out an email with only a single address in the “to” field. But it turns out it lists out all email address the email were sent to.

Here’s sample code I made close to what I actually did. Which the only important thing to note is how I used the ”to” method. Is that a proper usage? Or should I use a different approach to achieve what I was expecting?

$emails = [‘test@example.com’,’test2@example.com’];
//loads wiremail module and add subject body etc.
foreach($emails as $email){
 $wm->to($email);
}
$wm->send();

I did see in the sendgrid docs to use personalization, but I don’t think you’re using it in this module, are you?

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions