I ended up using http://wp-cli.org to make my life easier
wp search-replace 'community.mydomain.com' 'community.mydomain.dev' --network --dry-run
wp search-replace 'sub1.mydomain.com' 'sub1.mydomain.dev' --network --dry-run
wp search-replace 'sub2.mydomain.com' 'sub2.mydomain.dev' --network --dry-run-
github.com/swiftmailer/swiftmailer/
-
github.com/sendgrid/sendgrid-php/
<?php
$email_formal_name = "Somebody somewhere with a computer";
$email_user = "noreply@example.org";
$to= array("a1@example.org" => "A1", "a2@example.org" => "A2",);
$body .= "<br><br>";
$body .= "<table><tbody><tr><td>";
$body .= "<div>yourstuff</div>";
$body .= " </td></tr>";
$body .= "</tbody></table>";
$office_message = $body;
// transport
$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);
// message
$message = Swift_Message::newInstance();
$message->setSubject($office_subject);
$message->setFrom(array($email_from => $email_formal_name ));
$message->setReplyTo(array($email_user));
$message->setBody($office_message);
$message->addPart($office_message, 'text/html');
// Send the message
$failedRecipients = array();
$numSent = 0;
$to = $email_office;
foreach ($to as $address => $name)
{
if (is_int($address)) {
$message->setTo($name);
} else {
$message->setTo(array($address => $name));
}
$numSent += $mailer->send($message, $failedRecipients);
}
return $numSent === count($to);
?><?php
$sendgrid = new SendGrid('username', 'password');
$email = new SendGrid\Email();
$email->addTo('foo@example.org')->
addTo('dude@example.org')->
setFrom('me@example.org')->
setSubject('Subject goes here')->
setText('Hello World!')->
setHtml('<strong>Hello World!</strong>');
$sendgrid->send($email);
?>