Skip to content

The mailchimp-mailer should handle all the possible configuration of the API #40056

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

Closed
VincentLanglet opened this issue Feb 1, 2021 · 3 comments

Comments

@VincentLanglet
Copy link
Contributor

Description
The mailchimp mailer is based on the mandrill API and create a payload
https://github.com/symfony/mailchimp-mailer/blob/5.x/Transport/MandrillApiTransport.php#L77-L83

But this payload could have other values
https://mandrillapp.com/api/docs/messages.html

For instance I'm using a lot track_opens and track_clicks.

$message = [
    'to'           => $recipients,
    'html'         => $body,
    'subject'      => $subject,
    'from_email'   => $fromEmail,
    'attachments'  => $attachments,
    'track_opens'  => true,
    'track_clicks' => true,
];

It would be great to add these two values (and maybe all the possible options of the API).

How should it be implemented ?
Does it require something like Email::getOptions() ?

@fabpot
Copy link
Member

fabpot commented Feb 1, 2021

We are only implementing features that can be made generic enough to apply to almost all providers. See past PRs/issues on the same topic.

@VincentLanglet
Copy link
Contributor Author

See past PRs/issues on the same topic.

I looked for and didn't find something related. Do you have a topic in mind ?

We are only implementing features that can be made generic enough to apply to almost all providers.

I totally understand this point, that's why I proposed a getOptions method which could take every transport-specific features. But another solution I had in mind would be to add a Transport configuration.

mailchimp_transport.yaml

mailchimp_transport:
    track_opens: true
    track_clicks: true

and using the options when creating the message
https://github.com/symfony/mailchimp-mailer/blob/5.x/Transport/MandrillApiTransport.php#L77-L83

This way a feature specific to one transport is developed in this transport only.
Would it be better @fabpot ?

@fabpot
Copy link
Member

fabpot commented Feb 1, 2021

Again, I'm not interested in a generic way to pass options as I don't want to replace the official SDKs. If you need specific features, the official SDK is the way to go.

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

No branches or pull requests

3 participants