-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mandrill app mailer driver integration #3
Conversation
# Conflicts: # src/DataObjects/MailMessage.php # src/Mailer/MailerFactory.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update code
examples/form.php
Outdated
$mailerConfig = [ | ||
'mailer' => MailHandler::USE_MANDRILL, // (or USE_POSTMARKAPP, USE_MANDRILL) | ||
'password' => '_5mPSvb39BQqnA7G_dOaAA', | ||
'attachmentsSizeLimit' => 8000000, // around 8MB. | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to have another example for mandrill to keep files simple.
Let's rename files as:
- form2email-basic.php
- form2email-mandrill.php
src/Mailer/MandrillMailer.php
Outdated
|
||
$mandrillMessage = array( | ||
'html' => $message->getBody(), | ||
'text' => 'Example text content', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
src/Mailer/MandrillMailer.php
Outdated
} | ||
|
||
$mandrillMessage['to'] = $toArray; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit of spaghetti code. $toArray should be defined before if() - otherwise you can get undefined var.
and you can write 1 code for all parts like:
$recipients = ['to' => $message->getTo(), 'cc' => $message->getCc(), ...]
foreach($recipients as $type => $emails) {
if (empty($emails)) continue;
foreach($emails as $email) {
$to[] = [email, name, type => $type]
}
}
src/Mailer/MandrillMailer.php
Outdated
} | ||
|
||
$async = false; | ||
$ip_pool = 'Main Pool'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
examples/form.php
Outdated
// Mandrill config. | ||
$mailerConfig = [ | ||
'mailer' => MailHandler::USE_MANDRILL, // (or USE_POSTMARKAPP, USE_MANDRILL) | ||
'password' => '_5mPSvb39BQqnA7G_dOaAA', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not password - it's apiKey!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check format (according to sniffer) and you can merge
src/Mailer/MandrillMailer.php
Outdated
); | ||
|
||
// Recipients. | ||
$recipients = ['to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make normal format :)
No description provided.