@@ -14,8 +14,7 @@ MailerSend Python SDK
1414 - [ Send an email] ( #send-an-email )
1515 - [ Add CC, BCC recipients] ( #add-cc-bcc-recipients )
1616 - [ Send a template-based email] ( #send-a-template-based-email )
17- - [ Advanced personalization] ( #advanced-personalization )
18- - [ Simple personalization] ( #simple-personalization )
17+ - [ Personalization] ( #personalization )
1918 - [ Send email with attachment] ( #send-email-with-attachment )
2019 - [ Email Verification] ( #email-verification )
2120 - [ Get all email verification lists] ( #get-all-email-verification-lists )
@@ -365,12 +364,12 @@ mailer.set_mail_from(mail_from, mail_body)
365364mailer.set_mail_to(recipients, mail_body)
366365mailer.set_subject(" Hello from {$company}" , mail_body)
367366mailer.set_template(" templateID" , mail_body)
368- mailer.set_simple_personalization (variables, mail_body)
367+ mailer.set_personalization (variables, mail_body)
369368
370369mailer.send(mail_body)
371370```
372371
373- ### Advanced personalization
372+ ### Personalization
374373
375374``` python
376375from mailersend import emails
@@ -420,55 +419,7 @@ mailer.set_mail_to(recipients, mail_body)
420419mailer.set_subject(" Hello from {$company}" , mail_body)
421420mailer.set_html_content(" This is the HTML content, {$name}" , mail_body)
422421mailer.set_plaintext_content(" This is the text content, {$name}" , mail_body)
423- mailer.set_advanced_personalization(personalization, mail_body)
424-
425- mailer.send(mail_body)
426- ```
427-
428- ### Simple personalization
429-
430- ``` python
431- from mailersend import emails
432- from dotenv import load_dotenv
433-
434- load_dotenv()
435-
436- mailer = emails.NewEmail(os.getenv(' MAILERSEND_API_KEY' ))
437-
438- # define an empty dict to populate with mail values
439- mail_body = {}
440-
441- mail_from = {
442- " name" : " Your Name" ,
443- " email" : " your@domain.com" ,
444- }
445-
446- recipients = [
447- {
448- " name" : " Your Client" ,
449- " email" : " your@client.com" ,
450- }
451- ]
452-
453- variables = [
454- {
455- " email" : " your@client.com" ,
456- " substitutions" : [
457- {
458- " var" : " foo" ,
459- " value" : " bar"
460- },
461- ]
462- }
463- ]
464-
465-
466- mailer.set_mail_from(mail_from, mail_body)
467- mailer.set_mail_to(recipients, mail_body)
468- mailer.set_subject(" Hello from {$foo}" , mail_body)
469- mailer.set_html_content(" This is the HTML content, {$foo}" , mail_body)
470- mailer.set_plaintext_content(" This is the text content, {$foo}" , mail_body)
471- mailer.set_simple_personalization(variables, mail_body)
422+ mailer.set_personalization(personalization, mail_body)
472423
473424mailer.send(mail_body)
474425```
@@ -528,7 +479,7 @@ mailer.set_mail_to(recipients, mail_body)
528479mailer.set_subject(" Hello from {$foo}" , mail_body)
529480mailer.set_html_content(" This is the HTML content, {$foo}" , mail_body)
530481mailer.set_plaintext_content(" This is the text content, {$foo}" , mail_body)
531- mailer.set_simple_personalization (variables, mail_body)
482+ mailer.set_personalization (variables, mail_body)
532483mailer.set_attachments(attachments, mail_body)
533484
534485mailer.send(mail_body)
0 commit comments