@@ -103,50 +103,106 @@ sendgrid.send(email);
103103
104104### To
105105
106+ #### addTo
107+
106108``` java
107- email. addTo(" example@example.com" );
109+ email. addTo(" foo@example.com" );
110+ // or
111+ email. addTo([" foo@other.com" , " bar@other.com" ]);
112+ // or
113+ email. addTo(" foo.bar@other.com" , " Foo Bar" );
114+ ```
115+
116+ #### setTo
117+
118+ ``` java
119+ email. setTo([" foo@other.com" , " bar@other.com" ]);
120+ ```
121+
122+ #### addToName
123+
124+ ``` java
125+ email. addToName(" Foo" );
126+ // or
127+ email. addToName([" Foo" , " Bar" ]);
128+ ```
129+
130+ #### setToName
131+
132+ ``` java
133+ email. setToName([" Foo" , " Bar" ]);
134+ ```
135+
136+ #### addCc
137+
138+ ``` java
139+ email. addCc(" foo@example.com" );
108140// or
109- email. setTo([" other@other.com" ]);
141+ email. addCc([" foo@other.com" , " bar@other.com" ]);
142+ ```
143+
144+ #### setCc
145+
146+ ``` java
147+ email. setCc([" foo@other.com" , " bar@other.com" ]);
148+ ```
149+
150+ #### addBcc
151+
152+ ``` java
153+ email. addBcc(" foo@example.com" );
154+ // or
155+ email. addBcc([" foo@other.com" , " bar@other.com" ]);
156+ ```
157+
158+ #### setBcc
159+
160+ ``` java
161+ email. setBcc([" foo@other.com" , " bar@other.com" ]);
110162```
111163
112164### From
113165
166+ #### setFrom
167+
114168``` java
115169email. setFrom(" other@example.com" );
116170```
117171
118- ### From Name
172+ #### setFromName
119173
120174``` java
121175email. setFromName(" Other Dude" );
122176```
123177
124- ### Reply To
178+ #### setReplyTo
125179
126180``` java
127181email. setReplyTo(" no-reply@nowhere.com" );
128182```
129183
130- ### Subject
184+ #### setSubject
131185
132186``` java
133187email. setSubject(" Hello World" );
134188```
135189
136- ### Text
190+ #### setText
137191
138192``` java
139193email. setText(" This is some text of the email." );
140194```
141195
142- ### Html
196+ #### setHtml
143197
144198``` java
145199email. setHtml(" <h1>My first email through SendGrid" );
146200```
147201
148202### Attachments
149203
204+ #### addAttachment
205+
150206``` java
151207email. addAttachment(" text.txt" , " contents" );
152208// or
@@ -157,6 +213,8 @@ email.addAttachment("text.txt", new InputStream(new File("./file.txt")));
157213
158214### Content IDs
159215
216+ #### addContentId
217+
160218``` java
161219// First, add an attachment
162220email. addAttachment(" image.png" , new File (" ./image.png" ));
@@ -185,25 +243,36 @@ email.getSMTPAPI();
185243
186244### Recipients
187245
246+ #### addSmtpApiTo
247+
188248``` java
189- email. addSmtpApiTo(" email@email .com" );
249+ email. addSmtpApiTo(" foo@example .com" );
190250// or
191- email. addSmtpApiTo([" email@email .com" ]);
251+ email. addSmtpApiTo([" foo@other.com " , " bar@other .com" ]);
192252```
193253
194-
195254### [ Substitutions] ( http://sendgrid.com/docs/API_Reference/SMTP_API/substitution_tags.html )
196255
256+ #### addSubstitution
257+
197258``` java
198259email. addSubstitution(" key" , " value" );
199- // or
260+
261+ JSONObject subs = header. getSubstitutions();
262+ ```
263+
264+ #### setSubstitutions
265+
266+ ``` java
200267email. setSubstitutions(" key" , [" value1" , " value2" ]);
201268
202269JSONObject subs = header. getSubstitutions();
203270```
204271
205272### [ Unique Arguments] ( http://sendgrid.com/docs/API_Reference/SMTP_API/unique_arguments.html )
206273
274+ #### addUniqueAarg
275+
207276``` java
208277email. addUniqueAarg(" key" , " value" );
209278// or
@@ -219,37 +288,32 @@ email.setUniqueArgs(map);
219288
220289JSONObject args = email. getUniqueArgs();
221290```
291+
222292### [ Categories] ( http://sendgrid.com/docs/API_Reference/SMTP_API/categories.html )
223293
294+ #### addCategory
295+
224296``` java
225297email. addCategory(" category" );
226- // or
227- email. addCategory([" categories" ]);
228- // or
229- email. setCategories([" category1" , " category2" ]);
230- // or
231- email. setCategories([" category1" , category2" ]);
232298
233299String [] cats = email. getCategories();
234300```
235301
236302### [ Sections] ( http://sendgrid.com/docs/API_Reference/SMTP_API/section_tags.html )
237303
304+ #### addSection
305+
238306``` java
239307email. addSection(" key" , " section" );
240- // or
241- Map newSec = new HashMap();
242- newSec.put(" - section- " , " value" );
243- email.setSections(newSec);
244- // or
245- JSONObject newSec = new JSONObject();
246- newSec.put(" - section- " , " value" );
247- email.setSections(newSec);
248308
249309JSONObject sections = email. getSections();
250310```
251311
252- ### [Filters](http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html)
312+ ### [ Filters / Apps] ( http://sendgrid.com/docs/API_Reference/SMTP_API/apps.html )
313+
314+ You can enable and configure Apps.
315+
316+ #### addFilter
253317
254318``` java
255319email. addFilter(" filter" , " setting" , " value" );
@@ -258,15 +322,7 @@ email.addFilter("filter", "setting", 1);
258322JSONObject filters = email. getFilters();
259323```
260324
261- ### Get Headers
262-
263- ```java
264- String headers = email.jsonString();
265- ```
266-
267- ### Filters/Apps
268-
269- You can enable and configure Apps.
325+ Example enabling bcc app:
270326
271327``` java
272328SendGrid sendgrid = new SendGrid (" sendgrid_username" , " sendgrid_password" );
@@ -276,6 +332,22 @@ sendgrid.addFilter("bcc", "enabled", 1);
276332sendgrid. addFilter(" bcc" , " email" , " example@example.com" );
277333```
278334
335+ ### [ ASM - Advanced Supression Manager] ( https://sendgrid.com/docs/User_Guide/advanced_suppression_manager.html )
336+
337+ #### setASMGroupId
338+
339+ ``` java
340+ email. setASMGroupId(1 );
341+ ```
342+
343+ ### [ Schedule Sending] ( https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html )
344+
345+ #### setSendAt
346+
347+ ``` java
348+ email. setSendAt(1409348513 );
349+ ```
350+
279351## Contributing
280352
2813531 . Fork it
0 commit comments