Skip to content

Commit fb4959d

Browse files
Merge pull request #59 from mailersend/feature/update-readme
Remove simple personalization from readme
2 parents 73f8c8f + e2e73b2 commit fb4959d

File tree

1 file changed

+3
-56
lines changed

1 file changed

+3
-56
lines changed

README.md

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ MailerSend Java SDK
1111
- [Send an email](#send-an-email)
1212
- [Add CC, BCC recipients](#add-cc-bcc-recipients)
1313
- [Send a template-based email](#send-a-template-based-email)
14-
- [Advanced personalization](#advanced-personalization)
15-
- [Simple personalization](#simple-personalization)
14+
- [Personalization](#personalization)
1615
- [Send email with attachment](#send-email-with-attachment)
1716
- [Schedule an email](#schedule-an-email)
1817
- [Send bulk emails](#send-bulk-emails)
@@ -241,12 +240,6 @@ public void sendEmail() {
241240

242241
email.setTemplateId("Your MailerSend template ID");
243242

244-
// you can add a variable for a specific recipient
245-
email.addVariable(recipient, "variable name", "variable value");
246-
247-
// you can use the addVariable overload to add a variable to all recipients
248-
email.addVariable("all recipients variable name", "variable value");
249-
250243
MailerSend ms = new MailerSend();
251244

252245
ms.setToken("Your API token");
@@ -262,7 +255,7 @@ public void sendEmail() {
262255
}
263256
```
264257

265-
### Advanced personalization
258+
### Personalization
266259

267260
```java
268261
import com.mailersend.sdk.emails.Email;
@@ -290,7 +283,7 @@ public void sendEmail() {
290283
// you can add personalization for each recipient separately
291284
email.addPersonalization(recipient, "var2 name", "personalization value");
292285

293-
// you can also add POJOs as advanced personalization provided they can be serialized to JSON via Gson and do not have any object properties
286+
// you can also add POJOs as personalization provided they can be serialized to JSON via Gson and do not have any object properties
294287
MyPojo obj = new MyPojo();
295288
obj.property1 = "property 1 value";
296289
obj.array1 = {1, 2, 3, 4};
@@ -312,52 +305,6 @@ public void sendEmail() {
312305
}
313306
```
314307

315-
### Simple personalization
316-
317-
```java
318-
import com.mailersend.sdk.emails.Email;
319-
import com.mailersend.sdk.MailerSend;
320-
import com.mailersend.sdk.MailerSendResponse;
321-
import com.mailersend.sdk.exceptions.MailerSendException;
322-
323-
public void sendEmail() {
324-
325-
Email email = new Email();
326-
327-
email.setFrom("name", "your email");
328-
329-
email.setSubject("Subject {$var1} {$var2}");
330-
331-
email.setPlain("This is the text version with a {$var1} and a {$var2}.")
332-
email.setHtml("<p>This is the HTML version with a {$var1} and a {$var2}.</p>");
333-
334-
Recipient recipient = new Recipient("name", "your@recipient.com");
335-
336-
email.addRecipient(recipient);
337-
338-
email.setTemplateId("Your MailerSend template ID");
339-
340-
// you can add a variable for a specific recipient
341-
email.addVariable(recipient, "var1", "variable");
342-
343-
// you can use the addVariable overload to add a variable to all recipients
344-
email.addVariable("var2", "second variable");
345-
346-
MailerSend ms = new MailerSend();
347-
348-
ms.setToken("Your API token");
349-
350-
try {
351-
352-
MailerSendResponse response = ms.emails().send(email);
353-
System.out.println(response.messageId);
354-
} catch (MailerSendException e) {
355-
356-
e.printStackTrace();
357-
}
358-
}
359-
```
360-
361308
### Send email with attachment
362309

363310
```java

0 commit comments

Comments
 (0)