From 2162ade61ac1d89fce133ae8be649f80eb466b3e Mon Sep 17 00:00:00 2001 From: Martijn Date: Tue, 9 Apr 2019 11:16:50 +0200 Subject: [PATCH] Update mime message docs for new Swiftmailer version and lib parameter update (#585) --- doc/index.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/index.md b/doc/index.md index c76f32a..e47327b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -3,8 +3,8 @@ This page will document the API classes and ways to properly use the API. These resources will eventually move to the official documentation at [https://documentation.mailgun.com](https://documentation.mailgun.com/api_reference.html). -Other relevant documentation pages might be: - +Other relevant documentation pages might be: + * [Attachments](attachments.md) * [Pagination](pagination.md) * [Message Builder](/src/Message/README.md) @@ -90,9 +90,9 @@ $mailgun->events()->get('example.com'); #### Send a message ```php $parameters = [ - 'from' => 'bob@example.com', - 'to' => 'sally@example.com', - 'subject' => 'The PHP SDK is awesome!', + 'from' => 'bob@example.com', + 'to' => 'sally@example.com', + 'subject' => 'The PHP SDK is awesome!', 'text' => 'It is so simple to send a message.' ]; $mailgun->messages()->send('example.com', $parameters); @@ -102,10 +102,10 @@ $mailgun->messages()->send('example.com', $parameters); Below in an example how to create a Mime message with SwiftMailer. ```php -$message = \Swift_Message::newInstance('Mail Subject'); +$message = new Swift_Message('Mail Subject'); $message->setFrom(['from@exemple.com' => 'Example Inc']); $message->setTo(['user0gmail.com' => 'User 0', 'user1@hotmail.com' => 'User 1']); -// $message->setBcc('admin@example.com'); Do not do this, BCC will be visible for all receipients if you do. +// $message->setBcc('admin@example.com'); Do not do this, BCC will be visible for all receipients if you do. $message->setCc('invoice@example.com'); $messageBody = 'Look at the fancy HTML body.'; @@ -115,7 +115,7 @@ $message->setBody($messageBody, 'text/html'); $to = ['admin@example.com', 'user0gmail.com', 'user1@hotmail.com', 'invoice@example.com'] // Send the message -$mailgun->messages()->sendMime('example.com', $to, $message->toString()); +$mailgun->messages()->sendMime('example.com', $to, $message->toString(), []); ``` #### Show a stored message @@ -302,7 +302,7 @@ $valid = $mailgun->webhooks()->verifyWebhookSignature($timestamp, $token, $signa if (!$valid) { // Create a 403 response - + exit(); }