@@ -63,12 +63,18 @@ void testEmailWithAllOptions() throws Exception {
6363 .setHeader ("Content-Type" , "application/json" ));
6464
6565 Map <String , String > headers = new HashMap <>();
66- headers .put ("X-Custom-Header" , "custom-value" );
66+ headers .put ("Message-ID" , "<ticket-123@example.com>" );
67+ headers .put ("X-LM-Preserve-Message-ID" , "true" );
6768
6869 Map <String , Object > metadata = new HashMap <>();
6970 metadata .put ("userId" , "user_123" );
7071 metadata .put ("campaign" , "welcome" );
7172
73+ Map <String , Object > settings = new HashMap <>();
74+ settings .put ("track_opens" , false );
75+ settings .put ("track_clicks" , true );
76+ settings .put ("tls" , "enforced" );
77+
7278 SendEmailResponse response = lettermint .email ()
7379 .from ("John Doe <sender@example.com>" )
7480 .to ("recipient1@example.com" , "recipient2@example.com" )
@@ -84,7 +90,8 @@ void testEmailWithAllOptions() throws Exception {
8490 .attach ("invite.ics" , "base64icalFile" , null , "text/calendar; method=REQUEST" )
8591 .route ("route-slug-123" )
8692 .metadata (metadata )
87- .tag ("welcome" , "onboarding" )
93+ .tag ("welcome" )
94+ .settings (settings )
8895 .idempotencyKey ("unique-key-123" )
8996 .send ();
9097
@@ -103,7 +110,13 @@ void testEmailWithAllOptions() throws Exception {
103110 assertTrue (body .contains ("\" html\" :\" <p>Hello <b>World</b></p>\" " ));
104111 assertTrue (body .contains ("\" text\" :\" Hello World\" " ));
105112 assertTrue (body .contains ("\" route\" :\" route-slug-123\" " ));
106- assertTrue (body .contains ("\" tags\" :[\" welcome\" ,\" onboarding\" ]" ));
113+ assertTrue (body .contains ("\" tag\" :\" welcome\" " ));
114+ assertTrue (body .contains ("\" settings\" :" ));
115+ assertTrue (body .contains ("\" track_opens\" :false" ));
116+ assertTrue (body .contains ("\" track_clicks\" :true" ));
117+ assertTrue (body .contains ("\" tls\" :\" enforced\" " ));
118+ assertTrue (body .contains ("\" Message-ID\" :\" <ticket-123@example.com>\" " ));
119+ assertTrue (body .contains ("\" X-LM-Preserve-Message-ID\" :\" true\" " ));
107120 assertTrue (body .contains ("{\" filename\" :\" document.pdf\" ,\" content\" :\" base64content\" }" ));
108121 assertTrue (body .contains ("{\" filename\" :\" logo.png\" ,\" content\" :\" base64logo\" ,\" content_id\" :\" logo-cid\" }" ));
109122 assertTrue (body .contains ("{\" filename\" :\" invite.ics\" ,\" content\" :\" base64icalFile\" ,\" content_type\" :\" text/calendar; method=REQUEST\" }" ));
0 commit comments