Skip to content

Commit c152890

Browse files
committed
remark code in HTML
1 parent 4fb07db commit c152890

File tree

5 files changed

+47
-19
lines changed

5 files changed

+47
-19
lines changed

content/docs/for-developers/tracking-events/event.md

+23-18
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ navigation:
4747
- [marketing_campaign_name](#marketingcampaignname)
4848

4949
## Events
50-
50+
5151
Events are generated when email is processed by SendGrid and email service providers. There are two types of events - delivery and engagement events. Delivery events indicate the status of email delivery to the recipient. Engagement events indicate how the recipient is interacting with the email.
5252

5353
Here is a flow of email events:
@@ -181,7 +181,6 @@ Here is an event response that includes an example of each type of event:
181181
```
182182

183183
### Delivery events
184-
185184

186185
Delivery events include processed, dropped, delivered, deferred, and bounce.
187186

@@ -195,7 +194,10 @@ Delivery events include processed, dropped, delivered, deferred, and bounce.
195194
<tr>
196195
<td><a name="processed"></a>Processed</td>
197196
<td>Message has been received and is ready to be delivered.</td>
198-
<td>```json
197+
<td>
198+
<div class="gatsby-highlight" data-language="json">
199+
<pre class="language-json" >
200+
<code class="language-json">
199201
[
200202
{
201203
"email":"example@test.com",
@@ -208,10 +210,13 @@ Delivery events include processed, dropped, delivered, deferred, and bounce.
208210
"event":"processed",
209211
"category":"cat facts",
210212
"sg_event_id":"rbtnWrG1DVDGGGFHFyun0A==",
211-
"sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"
213+
"sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.000000000000000000000"
212214
}
213215
]
214-
```</td>
216+
</code>
217+
</pre>
218+
</div>
219+
</td>
215220
</tr>
216221
<tr>
217222
<td><a name="dropped"></a>Dropped</td>
@@ -292,7 +297,7 @@ Delivery events include processed, dropped, delivered, deferred, and bounce.
292297
</table>
293298
294299
### Engagement events
295-
300+
296301
Engagement events include open, click, spam report, unsubscribe, group unsubscribe, and group resubscribe.
297302
298303
<table class="table">
@@ -421,7 +426,7 @@ Engagement events include open, click, spam report, unsubscribe, group unsubscri
421426
</table>
422427
423428
## Event objects
424-
429+
425430
<table class="table">
426431
<tr>
427432
<th></th>
@@ -720,7 +725,7 @@ Engagement events include open, click, spam report, unsubscribe, group unsubscri
720725
</table>
721726
722727
### JSON objects
723-
728+
724729
- <a name="email"></a>`email` - the email address of the recipient
725730
- <a name="timestamp"></a>`timestamp` - the <a href="https://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of when the message was sent
726731
- <a name="event"></a>`event` - the event type. Possible values are processed, dropped, delivered, deferred, bounce, open, click, spam report, unsubscribe, group unsubscribe, and group resubscribe.
@@ -781,7 +786,7 @@ Array:
781786
- <a name="asmgroupid"></a>`asm_group_id` - The ID of the unsubscribe group the recipient's email address is included in. ASM IDs correspond to the ID that is returned when you create an unsubscribe group.
782787
- <a name="uniqueargs"></a>`unique_args` or `custom_args`
783788
## Unique Arguments and Custom Arguments
784-
789+
785790
Events generated by SendGrid can include [unique arguments]({{root_url}}/for-developers/sending-email/unique-arguments.html) or custom arguments.
786791

787792
<call-out>
@@ -791,7 +796,7 @@ Unique arguments and custom arguments essentially have the same function. Howeve
791796
</call-out>
792797

793798
### Unique Arguments
794-
799+
795800
To define and receive unique arguments when sending email with the [SMTP API]({{root_url}}/API_Reference/SMTP_API/index.html) or the [v2 Mail Send endpoint]({{root_url}}/API_Reference/Web_API/mail.html), use the `unique_args` parameter in the X-SMTPAPI header. For example, if you have an application and want to receive custom parameters such as the `userid` and the email `template`, you would submit them with the X-SMTPAPI header, as described [here]({{root_url}}/for-developers/sending-email/unique-arguments.html).
796801

797802
For example, if you include the following unique arguments in your x-smtpapi header for an email sent via the v2 Mail Send endpoint:
@@ -828,7 +833,7 @@ You can create unique arguments with the same words as reserved keys, such as "e
828833
</call-out>
829834

830835
### Reserved Keys in Unique Arguments
831-
836+
832837
```json
833838
//for this example, assume we're sending to john.doe@sendgrid.com
834839
{
@@ -843,7 +848,7 @@ You can create unique arguments with the same words as reserved keys, such as "e
843848
```
844849

845850
### The resulting webhook call
846-
851+
847852
```json
848853
[
849854
{
@@ -864,7 +869,7 @@ You'll notice that the unique arguments, "event" and "email", were overwritten b
864869
</call-out>
865870

866871
### Custom Arguments
867-
872+
868873
Any custom arguments that you include with an email sent through [v3 Mail Send]({{root_url}}/API_Reference/Web_API_v3/Mail/index.html) gets added to your Event Webhook response.
869874

870875
For example, if you were to include the following custom arguments in a personalization in your payload to the v3 Mail Send endpoint:
@@ -912,7 +917,7 @@ The Event Webhook response:
912917
For emails sent through our Marketing Campaigns feature, we add Marketing Campaigns specific parameters to the Event Webhook. Both `marketing_campaign_name` and `marketing_campaign_id` are displayed as unique arguments in the event data.
913918

914919
### Example event from a standard (non-A/B test) campaign send:
915-
920+
916921
```json
917922
{
918923
"category": [],
@@ -930,7 +935,7 @@ For emails sent through our Marketing Campaigns feature, we add Marketing Campai
930935
```
931936

932937
### Example event from an A/B Test:
933-
938+
934939
`marketing_campaign_version` is displayed in the event data for emails sent as part of an A/B Test. The value for `marketing_campaign_version` are returned as `A`, `B`, `C`, etc.
935940

936941
```json
@@ -952,7 +957,7 @@ For emails sent through our Marketing Campaigns feature, we add Marketing Campai
952957
```
953958

954959
### Example event from the winning phase of an A/B Test:
955-
960+
956961
```json
957962
{
958963
"category": [],
@@ -971,7 +976,7 @@ For emails sent through our Marketing Campaigns feature, we add Marketing Campai
971976
```
972977

973978
### Legacy Marketing Email Unsubscribes
974-
979+
975980
For emails sent through our Legacy Marketing Email tool, unsubscribes look like the following example:
976981

977982
```json
@@ -1013,7 +1018,7 @@ For emails sent through our Legacy Marketing Email tool, unsubscribes look like
10131018
```
10141019

10151020
## Additional Resources
1016-
1021+
10171022
- [Getting started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook.html)
10181023
- [Troubleshooting the event webhook]({{root_url}}/for-developers/tracking-events/troubleshooting.html)
10191024
- [An Event Webhook case study](https://sendgrid.com/blog/leveraging-sendgrids-event-api/)

gatsby-browser.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
exports.onClientEntry = () => {
2+
(function () {
3+
const path = 'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css';
4+
const link = document.createElement('link');
5+
link.setAttribute('rel', 'stylesheet');
6+
link.setAttribute('type', 'text/css');
7+
link.setAttribute('href', path);
8+
document.head.appendChild(link);
9+
}());
10+
};

gatsby-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module.exports = {
4646
resolve: 'gatsby-transformer-remark',
4747
options: {
4848
plugins: [
49+
'sendgrid-remark-code-in-html',
4950
'sendgrid-remark-paths',
5051
{
5152
resolve: 'gatsby-remark-images',
@@ -78,7 +79,6 @@ module.exports = {
7879
},
7980
'gatsby-plugin-sharp',
8081
'gatsby-plugin-catch-links',
81-
// 'gatsby-plugin-sitemap',
8282
{
8383
resolve: 'gatsby-plugin-manifest',
8484
options: {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const visit = require('unist-util-visit');
2+
3+
module.exports = ({ markdownAST }) => {
4+
visit(markdownAST, 'html', (node) => {
5+
let remarked = node.value.replace(/```/g, '<pre>');
6+
remarked = remarked.replace(/```/g, '</pre>');
7+
node.value = remarked;
8+
console.log(node);
9+
});
10+
11+
return markdownAST;
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)