@@ -4,29 +4,33 @@ Use the `setDataResidency` setter to specify which host to send to:
44
55Send to EU (data-residency: ` https://api.eu.sendgrid.com/ ` )
66``` js
7+ const client = require (' @sendgrid/client' );
78const sgMail = require (' @sendgrid/mail' );
8- sgMail .setDataResidency (' eu' );
9+ client .setDataResidency (' eu' );
910const msg = {
1011 to: ' recipient@example.org' ,
1112 from: ' sender@example.org' ,
1213 subject: ' Hello world' ,
1314 text: ' Hello plain world!' ,
1415 html: ' <p>Hello HTML world!</p>' ,
1516};
17+ sgMail .setClient (client);
1618sgMail .send (msg);
1719```
1820Send to Global region, this is also the default host, if the setter is not used
1921(data-residency: ` https://api.sendgrid.com/ ` )
2022``` js
23+ const client = require (' @sendgrid/client' );
2124const sgMail = require (' @sendgrid/mail' );
22- sgMail .setDataResidency (' global' );
25+ client .setDataResidency (' global' );
2326const msg = {
2427 to: ' recipient@example.org' ,
2528 from: ' sender@example.org' ,
2629 subject: ' Hello world' ,
2730 text: ' Hello plain world!' ,
2831 html: ' <p>Hello HTML world!</p>' ,
2932};
33+ sgMail .setClient (client);
3034sgMail .send (msg);
3135```
3236
0 commit comments