Skip to content

Commit

Permalink
sendgrid#765 - Updating the troubleshooting.md
Browse files Browse the repository at this point in the history
Added the sendgrid#692 multi line codes in <pre> turn to one line after mail send,
to the troubleshooting.md on your request.

Co-Authored-By: Elmer Thomas <elmer@thinkingserious.com>
  • Loading branch information
ssiddhantsharma and thinkingserious committed Oct 7, 2018
1 parent f0449de commit bae6f26
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
* [Environment Variables and Your SendGrid API Key](#environment)
* [Using the Package Manager](#package-manager)
* [Viewing the Request Body](#request-body)
* [Wrapping Text](#wrapping-text)

<a name="migrating"></a>
## Migrating from v2 to v3
Expand Down Expand Up @@ -126,3 +127,45 @@ const mail = Mail.create(data);
const body = mail.toJSON();
console.log(body);
```

<a name="wrapping-text"></a>
## Wrapping Text

You can write blog posts using e-mail with the help of SENDGRID API, like so:
```javascript
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
let msg = {
to: '<your-name>@blogger.com',
from: '<your-name>@gmail.com',
subject: title,
html: html,
};
sgMail.send(msg);
```
You can also wrap the text in the HTML to make a multi-line blog post:
```javascript
<div style="white-space: pre-wrap;">
<code> int a = 10;
int b = 10;
int d = 10;
</code>
</div>
```


















0 comments on commit bae6f26

Please sign in to comment.