Skip to content

Commit c445f1d

Browse files
Merge pull request #785 from ssiddhantsharma/ssiddhant-1
#765 - Updating the troubleshooting.md
2 parents 65bf16c + 957f806 commit c445f1d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
1313
* [Environment Variables and Your SendGrid API Key](#environment)
1414
* [Using the Package Manager](#package-manager)
1515
* [Viewing the Request Body](#request-body)
16+
* [Wrapping Text](#wrapping-text)
1617

1718
<a name="migrating"></a>
1819
## Migrating from v2 to v3
@@ -132,3 +133,27 @@ const mail = Mail.create(data);
132133
const body = mail.toJSON();
133134
console.log(body);
134135
```
136+
137+
<a name="wrapping-text"></a>
138+
## Wrapping Text
139+
140+
You can write blog posts using e-mail with the help of SendGrid API, like so:
141+
```javascript
142+
sgMail.setApiKey(process.env.SendGrid_API_KEY);
143+
let msg = {
144+
to: '<your-name>@blogger.com',
145+
from: '<your-name>@gmail.com',
146+
subject: title,
147+
html: html,
148+
};
149+
sgMail.send(msg);
150+
```
151+
You can also wrap the text in the HTML to make a multi-line blog post:
152+
```javascript
153+
<div style="white-space: pre-wrap;">
154+
<code>
155+
int a = 10;
156+
int b = 10;
157+
int d = 10;
158+
</code>
159+
</div>

0 commit comments

Comments
 (0)