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

#765 - Updating the troubleshooting.md #785

Merged
merged 4 commits into from
Oct 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
ssiddhantsharma marked this conversation as resolved.
Show resolved Hide resolved
ssiddhantsharma marked this conversation as resolved.
Show resolved Hide resolved
```javascript
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
let msg = {
ssiddhantsharma marked this conversation as resolved.
Show resolved Hide resolved
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;
ssiddhantsharma marked this conversation as resolved.
Show resolved Hide resolved
int b = 10;
int d = 10;
</code>
</div>
```

ssiddhantsharma marked this conversation as resolved.
Show resolved Hide resolved