File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,22 @@ public static Mail buildHelloEmail() {
241241 return mail ;
242242 }
243243
244+ // Multiple Reply-To addresses on a Mail
245+ public static Mail buildMultipleReplyToEmail () {
246+ Email from = new Email ("from@example.com" );
247+ String subject = "Hello World from the Twilio SendGrid Java Library" ;
248+ Email to = new Email ("to@example.com" );
249+ Content content = new Content ("text/plain" , "some text here" );
250+ Mail mail = new Mail (from , subject , to , content );
251+
252+ Email replyTo1 = new Email ("replyto1@example.com" );
253+ Email replyTo2 = new Email ("replyto2@example.com" );
254+ mail .setReplyTo (Arrays .asList (replyTo1 , replyTo2 ));
255+
256+ return mail ;
257+ }
258+
259+
244260 public static void baselineExample () throws IOException {
245261 final Mail helloWorld = buildHelloEmail ();
246262 send (helloWorld );
@@ -256,6 +272,11 @@ public static void dynamicTemplateExample() throws IOException {
256272 send (dynamicTemplate );
257273 }
258274
275+ public static void MultipleReplyToExample () throws IOException {
276+ final Mail multipleReplyTo = buildMultipleReplyToEmail ();
277+ send (multipleReplyTo );
278+ }
279+
259280 private static void send (final Mail mail ) throws IOException {
260281 final SendGrid sg = new SendGrid (System .getenv ("SENDGRID_API_KEY" ));
261282 sg .addRequestHeader ("X-Mock" , "true" );
You can’t perform that action at this time.
0 commit comments