s-ichikawa / laravel-sendgrid-driver

This library can add sendgrid driver into the laravel's mail configure.
MIT License
391 stars 91 forks source link

Multiple e-mails in `to` field #106

Open ajanini opened 5 years ago

ajanini commented 5 years ago

Hello,

How can I set multiple addresses in the to field?

I've tried:

$config = [
    'personalizations' => [
        [
            'to' => [
                [
                    'email' => 'user1@example.com',
                    'name'  => 'user1',
                ],
                [
                    'email' => 'user2@example.com',
                    'name'  => 'user2',
                ],
            ],
            'substitutions' => [
                '%company%' => 'Acme',
            ],
        ],
    ],
];

and

$config = [
    'personalizations' => [
        [
            'to' => [
                'user1@example.com',
                'user2@example.com',
            ],
            'substitutions' => [
                '%company%' => 'Acme',
            ],
        ],
    ],
];

Is this not possible?

ajanini commented 5 years ago

I think the same goes for cc and bcc fields.

s-ichikawa commented 5 years ago

Thanks, this is good issue. Now, it seems impossible to send in this way. I want to fix it but I'm on a vacation now. If you are harried, Please create the PR.

ajanini commented 5 years ago

Thanks @s-ichikawa. I have no experience creating a PR. I'm gonna study it, but hope you can fix it sooner than I can.