Skip to content
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

Merged
merged 6 commits into from
Jan 31, 2018

Conversation

aprokopenko
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@aprokopenko aprokopenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update code

$mailerConfig = [
'mailer' => MailHandler::USE_MANDRILL, // (or USE_POSTMARKAPP, USE_MANDRILL)
'password' => '_5mPSvb39BQqnA7G_dOaAA',
'attachmentsSizeLimit' => 8000000, // around 8MB.
];
Copy link
Contributor Author

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


$mandrillMessage = array(
'html' => $message->getBody(),
'text' => 'Example text content',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

}

$mandrillMessage['to'] = $toArray;
}
Copy link
Contributor Author

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]
}
}

}

$async = false;
$ip_pool = 'Main Pool';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this?

// Mandrill config.
$mailerConfig = [
'mailer' => MailHandler::USE_MANDRILL, // (or USE_POSTMARKAPP, USE_MANDRILL)
'password' => '_5mPSvb39BQqnA7G_dOaAA',
Copy link
Contributor Author

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!

Copy link
Contributor Author

@aprokopenko aprokopenko left a 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

);

// Recipients.
$recipients = ['to' => $message->getTo(), 'cc' => $message->getCc(), 'bcc' => $message->getBcc()];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make normal format :)

@aprokopenko aprokopenko merged commit a9f1c5c into master Jan 31, 2018
@aprokopenko aprokopenko deleted the feature/16410929_mandrill branch January 31, 2018 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants