{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/email-api/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition","tabs","tab"]},"type":"markdown"},"seo":{"title":"Personalization - Mailjet Send API v3","siteUrl":"https://dev.mailjet.com/","projectTitle":"Mailjet Developer Documentation","description":"Personalize transactional emails in Mailjet Send API v3 using Vars and contact data with [[var:NAME]] placeholders, covering global and per-recipient overrides.","image":"https://dev.mailjet.com/og-image.png","lang":"en-US","keywords":["Mailjet API","Email API","Content API","SMTP Relay","transactional email","email delivery","Send API","email templates","developer documentation"],"meta":[{"name":"og:type","content":"website"},{"name":"og:site_name","content":"Mailjet Developer Documentation"},{"name":"twitter:card","content":"summary_large_image"},{"name":"robots","content":"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"},{"name":"googlebot","content":"index, follow, max-snippet:-1, max-image-preview:large"}],"jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://dev.mailjet.com/#organization","name":"Mailjet","alternateName":"Sinch Mailjet","url":"https://www.mailjet.com","logo":"https://assets.mailjet.com/lib/images/mailjetLogo/mj_logo_with_text_color.png","parentOrganization":{"@type":"Organization","name":"Sinch","url":"https://www.sinch.com"}},{"@type":"WebSite","@id":"https://dev.mailjet.com/#website","name":"Mailjet Developer Documentation","description":"Official developer documentation for the Mailjet Email API, Content API and SMTP Relay.","url":"https://dev.mailjet.com/","inLanguage":"en-US","publisher":{"@id":"https://dev.mailjet.com/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://dev.mailjet.com/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]},"llmstxt":{"hide":false,"title":"Mailjet Developer Documentation","description":"Developer documentation for the Mailjet Email API, Content API and SMTP Relay - guides, API references and code samples for sending, templating and tracking email at scale.","details":{"content":"Mailjet (part of Sinch) provides APIs for sending and managing email.\n\nThis documentation covers four main areas:\n\n- **Email API** - the Send API (v3 and v3.1) for transactional and marketing email,\n  plus contact management, segmentation, campaigns, statistics, webhooks, the Parse API\n  and the Mailjet Templating Language.\n- **Content API** - programmatic management of email templates, template contents,\n  images, labels and authentication tokens (v1).\n- **SMTP Relay** - sending through Mailjet's SMTP servers, including custom headers.\n- **API Reference** - the complete, generated reference for every endpoint, built directly\n  from the OpenAPI specifications.\n\nBase URL for all REST APIs: `https://api.mailjet.com`.\nAuthentication uses HTTP Basic auth with an API key and secret key.\n\n## Machine-readable entry points\n\nPrefer these when you need the API surface in as few requests as possible:\n\n- `/openapi/openapi-mailjet.md` - the **complete** Email API reference (every endpoint,\n  grouped by resource) as a single Markdown document.\n- `/openapi/openapi-passport.md` - the **complete** Content API reference as a single\n  Markdown document.\n- `/_bundle/openapi/openapi-mailjet.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Email API.\n- `/_bundle/openapi/openapi-passport.yaml` - the raw, fully bundled OpenAPI 3 description\n  of the Content API.\n- `/sitemap.xml` - every indexable URL on this site.\n\nEvery page on this site is also available as clean Markdown by appending `.md` to its URL."},"sections":[{"title":"Email API","description":"Sending, contacts, campaigns, statistics, webhooks and templating.","includeFiles":["docs/email-api/**/*.md"],"excludeFiles":[]},{"title":"Content API","description":"Manage templates, template contents, images, labels and tokens.","includeFiles":["docs/content-api/**/*.md","docs/content-api.md"],"excludeFiles":[]},{"title":"SMTP Relay","description":"Send email through Mailjet's SMTP servers.","includeFiles":["docs/smtp-relay/**/*.md"],"excludeFiles":[]},{"title":"API Reference","description":"Complete generated reference for every Mailjet API endpoint.","includeFiles":["openapi/openapi-mailjet.yaml","openapi/openapi-passport.yaml","docs/api-reference/**/*.md"],"excludeFiles":[]},{"title":"Migrating from Mandrill","description":"Guides for switching from Mandrill to Mailjet.","includeFiles":["docs/mandrill/**/*.md"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following adheres to Send API v3.0"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"personalization","__idx":0},"children":["Personalization"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"content-formatting","__idx":1},"children":["Content Formatting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mailjet system allows to insert data in your text or html parts."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To do so, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[[DATA_TYPE:DATA_NAME]]"]}," where:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DATA_TYPE"]},": var for Vars specified in the API call or data for contact data already available on Mailjet system"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DATA_NAME"]},": name of the data you want to insert"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-vars-and-custom-vars","__idx":2},"children":["Use vars and custom vars"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By using Vars in conjunction with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[[var:VAR_NAME]]"]},", you can modify the content of you email."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example","__idx":3},"children":["Example"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"# This call sends an email to 2 given recipient with global personalization.\ncurl -s \\\n\t-X POST \\\n\t--user \"$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE\" \\\n\thttps://api.mailjet.com/v3/send \\\n\t-H 'Content-Type: application/json' \\\n\t-d '{\n\t\t\"FromEmail\":\"pilot@mailjet.com\",\n\t\t\"FromName\":\"Mailjet Pilot\",\n\t\t\"Subject\":\"Your email flight plan!\",\n\t\t\"Text-part\":\"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!\",\n\t\t\"Html-part\":\"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!\",\n\t\t\"Vars\":{\"day\":\"Monday\"},\n\t\t\"Recipients\":[{\"Email\":\"passenger1@mailjet.com\",\"Name\":\"passenger 1\"},{\"Email\":\"passenger2@mailjet.com\",\"Name\":\"passenger 2\"}]\n\t}'\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n/*\nThis call sends an email to 2 given recipient with global personalization.\n*/\nrequire 'vendor/autoload.php';\nuse \\Mailjet\\Resources;\n$mj = new \\Mailjet\\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));\n$body = [\n    'FromEmail' => \"pilot@mailjet.com\",\n    'FromName' => \"Mailjet Pilot\",\n    'Subject' => \"Your email flight plan!\",\n    'Text-part' => \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!\",\n    'Html-part' => \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!\",\n    'Vars' => [\n        'day' => \"Monday\"\n    ],\n    'Recipients' => [\n        [\n            'Email' => \"passenger1@mailjet.com\",\n            'Name' => \"passenger 1\"\n        ],\n        [\n            'Email' => \"passenger2@mailjet.com\",\n            'Name' => \"passenger 2\"\n        ]\n    ]\n];\n$response = $mj->post(Resources::$Email, ['body' => $body]);\n$response->success() && var_dump($response->getData());\n?>\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Node.js","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"/**\n *\n * This call sends an email to 2 given recipient with global personalization.\n *\n */\nconst mailjet = require('node-mailjet').connect(\n  process.env.MJ_APIKEY_PUBLIC,\n  process.env.MJ_APIKEY_PRIVATE\n)\nconst request = mailjet.post('send').request({\n  FromEmail: 'pilot@mailjet.com',\n  FromName: 'Mailjet Pilot',\n  Subject: 'Your email flight plan!',\n  'Text-part':\n    'Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!',\n  'Html-part':\n    '<h3>Dear passenger, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!',\n  Vars: { day: 'Monday' },\n  Recipients: [\n    { Email: 'passenger1@mailjet.com', Name: 'passenger 1' },\n    { Email: 'passenger2@mailjet.com', Name: 'passenger 2' },\n  ],\n})\nrequest\n  .then(result => {\n    console.log(result.body)\n  })\n  .catch(e => {\n    console.log(e.statusCode)\n  })\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"Mailjet.configure do |config|\n  config.api_key = ENV['MJ_APIKEY_PUBLIC']\n  config.secret_key = ENV['MJ_APIKEY_PRIVATE']\n  config.default_from = 'your default sending address'\nend\nvariable = Mailjet::Send.create(\n  'FromEmail' => 'pilot@mailjet.com',\n  'FromName' => 'Mailjet Pilot',\n  'Subject' => 'Your email flight plan!',\n  'Text-part' => 'Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!',\n  'Html-part' => '<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!',\n  'Vars' => {'day' => 'Monday'},\n  'Recipients' => [\n      {'Email' => 'passenger1@mailjet.com','Name' => 'passenger 1'},\n      {'Email' => 'passenger2@mailjet.com','Name' => 'passenger 2'}\n  ]\n)\n","lang":"ruby"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"\"\"\"\nThis call sends an email to 2 given recipient with global personalization.\n\"\"\"\nfrom mailjet_rest import Client\nimport os\napi_key = os.environ['MJ_APIKEY_PUBLIC']\napi_secret = os.environ['MJ_APIKEY_PRIVATE']\nmailjet = Client(auth=(api_key, api_secret))\ndata = {\n  'FromEmail': 'pilot@mailjet.com',\n  'FromName': 'Mailjet Pilot',\n  'Subject': 'Your email flight plan!',\n  'Text-part': 'Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!',\n  'Html-part': '<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!',\n  'Vars': {\n\t\t\t\"day\": \"Monday\"\n\t\t},\n  'Recipients': [\n\t\t{\n\t\t\t\"Email\": \"passenger1@mailjet.com\",\n\t\t\t\"Name\": \"passenger 1\"\n\t\t},\n\t\t{\n\t\t\t\"Email\": \"passenger2@mailjet.com\",\n\t\t\t\"Name\": \"passenger 2\"\n\t\t}\n\t]\n}\nresult = mailjet.send.create(data=data)\nprint result.status_code\nprint result.json()\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"package MyClass;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Email;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * This call sends an email to 2 given recipient with global personalization.\n     */\n    public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(System.getenv(\"MJ_APIKEY_PUBLIC\"), System.getenv(\"MJ_APIKEY_PRIVATE\"));\n      request = new MailjetRequest(Email.resource)\n\t\t\t\t\t\t.property(Email.FROMEMAIL, \"pilot@mailjet.com\")\n\t\t\t\t\t\t.property(Email.FROMNAME, \"Mailjet Pilot\")\n\t\t\t\t\t\t.property(Email.SUBJECT, \"Your email flight plan!\")\n\t\t\t\t\t\t.property(Email.TEXTPART, \"Dear passenger, welcome to Mailjet! On this [[var:day:\\\"monday\\\"]], may the delivery force be with you!\")\n\t\t\t\t\t\t.property(Email.HTMLPART, \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day:\\\"monday\\\"]], may the delivery force be with you!\")\n\t\t\t\t\t\t.property(Email.VARS, new JSONObject()\n                .put(\"day\", \"Monday\"))\n\t\t\t\t\t\t.property(Email.RECIPIENTS, new JSONArray()\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger1@mailjet.com\")\n                    .put(\"Name\", \"passenger 1\"))\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger2@mailjet.com\")\n                    .put(\"Name\", \"passenger 2\")));\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"/*\nThis call sends an email to 2 given recipient with global personalization.\n*/\npackage main\nimport (\n\t\"fmt\"\n\t. \"github.com/mailjet/mailjet-apiv3-go\"\n\t\"os\"\n)\ntype  MyVarsStruct  struct {\n  Day  string\n}\nfunc main () {\n\tmailjetClient := NewMailjetClient(os.Getenv(\"MJ_APIKEY_PUBLIC\"), os.Getenv(\"MJ_APIKEY_PRIVATE\"))\n\temail := &InfoSendMail {\n      FromEmail: \"pilot@mailjet.com\",\n      FromName: \"Mailjet Pilot\",\n      Subject: \"Your email flight plan!\",\n      TextPart: \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!\",\n      HTMLPart: \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!\",\n      Vars: MyVarsStruct {\n        Day: \"Monday\",\n      },\n      Recipients: []Recipient {\n        Recipient {\n          Email: \"passenger1@mailjet.com\",\n          Name: \"passenger 1\",\n        },\n        Recipient {\n          Email: \"passenger2@mailjet.com\",\n          Name: \"passenger 2\",\n        },\n      },\n    }\n\tres, err := mailjetClient.SendMail(email)\n\tif err != nil {\n\t\t\tfmt.Println(err)\n\t} else {\n\t\t\tfmt.Println(\"Success\")\n\t\t\tfmt.Println(res)\n\t}\n}\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using Mailjet.Client;\nusing Mailjet.Client.Resources;\nusing System;\nusing Newtonsoft.Json.Linq;\nnamespace Mailjet.ConsoleApplication\n{\n   class Program\n   {\n      /// <summary>\n      /// This call sends an email to 2 given recipient with global personalization.\n      /// </summary>\n      static void Main(string[] args)\n      {\n         RunAsync().Wait();\n      }\n      static async Task RunAsync()\n      {\n         MailjetClient client = new MailjetClient(Environment.GetEnvironmentVariable(\"MJ_APIKEY_PUBLIC\"), Environment.GetEnvironmentVariable(\"MJ_APIKEY_PRIVATE\"));\n         MailjetRequest request = new MailjetRequest\n         {\n            Resource = Send.Resource,\n         }\n            .Property(Send.FromEmail, \"pilot@mailjet.com\")\n            .Property(Send.FromName, \"Mailjet Pilot\")\n            .Property(Send.Subject, \"Your email flight plan!\")\n            .Property(Send.TextPart, \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you!\")\n            .Property(Send.HtmlPart, \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you!\")\n            .Property(Send.Vars, new JObject {\n                {\"day\", \"Monday\"}\n                })\n            .Property(Send.Recipients, new JArray {\n                new JObject {\n                 {\"Email\", \"passenger1@mailjet.com\"},\n                 {\"Name\", \"passenger 1\"}\n                 },\n                new JObject {\n                 {\"Email\", \"passenger2@mailjet.com\"},\n                 {\"Name\", \"passenger 2\"}\n                 }\n                });\n         MailjetResponse response = await client.PostAsync(request);\n         if (response.IsSuccessStatusCode)\n         {\n            Console.WriteLine(string.Format(\"Total: {0}, Count: {1}\\n\", response.GetTotal(), response.GetCount()));\n            Console.WriteLine(response.GetData());\n         }\n         else\n         {\n            Console.WriteLine(string.Format(\"StatusCode: {0}\\n\", response.StatusCode));\n            Console.WriteLine(string.Format(\"ErrorInfo: {0}\\n\", response.GetErrorInfo()));\n            Console.WriteLine(string.Format(\"ErrorMessage: {0}\\n\", response.GetErrorMessage()));\n         }\n      }\n   }\n}\n","lang":"csharp"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To go further in personalization ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Vars"]}," is also available for each recipient. The main ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Vars"]}," will be overidden by the recipient ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Vars"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-1","__idx":4},"children":["Example"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"# This call sends an email to 2 recipients with global and contact personalization.\ncurl -s \\\n\t-X POST \\\n\t--user \"$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE\" \\\n\thttps://api.mailjet.com/v3/send \\\n\t-H 'Content-Type: application/json' \\\n\t-d '{\n\t\t\"FromEmail\":\"pilot@mailjet.com\",\n\t\t\"FromName\":\"Mailjet Pilot\",\n\t\t\"Subject\":\"Your email flight plan!\",\n\t\t\"Text-part\":\"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n\t\t\"Html-part\":\"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n\t\t\"Vars\":{\"day\":\"Monday\"},\n\t\t\"Recipients\":[{\"Email\":\"passenger1@mailjet.com\",\"Name\":\"passenger 1\",\"Vars\":{\"day\":\"Tuesday\",\"personalmessage\":\"Happy birthday!\"}},{\"Email\":\"passenger2@mailjet.com\",\"Name\":\"passenger 2\"}]\n\t}'\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n/*\nThis call sends an email to 2 recipients with global and contact personalization.\n*/\nrequire 'vendor/autoload.php';\nuse \\Mailjet\\Resources;\n$mj = new \\Mailjet\\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));\n$body = [\n    'FromEmail' => \"pilot@mailjet.com\",\n    'FromName' => \"Mailjet Pilot\",\n    'Subject' => \"Your email flight plan!\",\n    'Text-part' => \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n    'Html-part' => \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n    'Vars' => [\n        'day' => \"Monday\"\n    ],\n    'Recipients' => [\n        [\n            'Email' => \"passenger1@mailjet.com\",\n            'Name' => \"passenger 1\",\n            'Vars' => [\n                'day' => \"Tuesday\",\n                'personalmessage' => \"Happy birthday!\"\n            ]\n        ],\n        [\n            'Email' => \"passenger2@mailjet.com\",\n            'Name' => \"passenger 2\"\n        ]\n    ]\n];\n$response = $mj->post(Resources::$Email, ['body' => $body]);\n$response->success() && var_dump($response->getData());\n?>\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Node.js","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"/**\n *\n * This call sends an email to 2 recipients with global and contact personalization.\n *\n */\nvar mailjet = require('node-mailjet').connect(\n  process.env.MJ_APIKEY_PUBLIC,\n  process.env.MJ_APIKEY_PRIVATE\n)\nvar request = mailjet.post('send').request({\n  FromEmail: 'pilot@mailjet.com',\n  FromName: 'Mailjet Pilot',\n  Subject: 'Your email flight plan!',\n  'Text-part':\n    'Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]',\n  'Html-part':\n    '<h3>Dear passenger, welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]',\n  Vars: { day: 'Monday' },\n  Recipients: [\n    {\n      Email: 'passenger1@mailjet.com',\n      Name: 'passenger 1',\n      Vars: { day: 'Tuesday', personalmessage: 'Happy birthday!' },\n    },\n    { Email: 'passenger2@mailjet.com', Name: 'passenger 2' },\n  ],\n})\nrequest\n  .then(result => {\n    console.log(result.body)\n  })\n  .catch(error => {\n    console.log(error.statusCode)\n  })\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"Mailjet.configure do |config|\n  config.api_key = ENV['MJ_APIKEY_PUBLIC']\n  config.secret_key = ENV['MJ_APIKEY_PRIVATE']\n  config.default_from = 'your default sending address'\nend\nvariable = Mailjet::Send.create(\n  from_email: \"pilot@mailjet.com\",\n  from_name: \"Mailjet Pilot\",\n  subject: \"Your email flight plan!\",\n  text_part: \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n  html_part: \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n  vars: {'day' => 'Monday'},\n  recipients: [\n    {'Email' => 'passenger1@mailjet.com', 'Name' => 'passenger 1', 'Vars' => {'day' => 'Tuesday', 'personalmessage' => 'Happy birthday!'}},\n    {'Email' => 'passenger2@mailjet.com', 'Name' => 'passenger 2'}]\n)\n","lang":"ruby"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"\"\"\"\nThis call sends an email to 2 recipients with global and contact personalization.\n\"\"\"\nfrom mailjet_rest import Client\nimport os\napi_key = os.environ['MJ_APIKEY_PUBLIC']\napi_secret = os.environ['MJ_APIKEY_PRIVATE']\nmailjet = Client(auth=(api_key, api_secret))\ndata = {\n  'FromEmail': 'pilot@mailjet.com',\n  'FromName': 'Mailjet Pilot',\n  'Subject': 'Your email flight plan!',\n  'Text-part': 'Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]',\n  'Html-part': '<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]',\n  'Vars': {\n\t\t\"day\": \"Monday\"\n  },\n  'Recipients': [\n\t\t{\n\t\t\t\"Email\": \"passenger1@mailjet.com\",\n\t\t\t\"Name\": \"passenger 1\",\n\t\t\t\"Vars\": {\n\t\t\t\t\"day\": \"Tuesday\",\n\t\t\t\t\"personalmessage\": \"Happy birthday!\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"Email\": \"passenger2@mailjet.com\",\n\t\t\t\"Name\": \"passenger 2\"\n\t\t}\n\t]\n}\nresult = mailjet.send.create(data=data)\nprint result.status_code\nprint result.json()\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"package MyClass;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Email;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * This call sends an email to 2 recipients with global and contact personalization.\n     */\n    public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(System.getenv(\"MJ_APIKEY_PUBLIC\"), System.getenv(\"MJ_APIKEY_PRIVATE\"));\n      request = new MailjetRequest(Email.resource)\n\t\t\t\t\t\t.property(Email.FROMEMAIL, \"pilot@mailjet.com\")\n\t\t\t\t\t\t.property(Email.FROMNAME, \"Mailjet Pilot\")\n\t\t\t\t\t\t.property(Email.SUBJECT, \"Your email flight plan!\")\n\t\t\t\t\t\t.property(Email.TEXTPART, \"Dear passenger, welcome to Mailjet! On this [[var:day:\\\"monday\\\"]], may the delivery force be with you! [[var:personalmessage:\\\"\\\"]]\")\n\t\t\t\t\t\t.property(Email.HTMLPART, \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day:\\\"monday\\\"]], may the delivery force be with you! [[var:personalmessage:\\\"\\\"]]\")\n\t\t\t\t\t\t.property(Email.VARS, new JSONObject()\n                .put(\"day\", \"Monday\"))\n\t\t\t\t\t\t.property(Email.RECIPIENTS, new JSONArray()\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger1@mailjet.com\")\n                    .put(\"Name\", \"passenger 1\")\n                    .put(\"Vars\", new JSONObject()\n                        .put(\"day\", \"Tuesday\")\n                        .put(\"personalmessage\", \"Happy birthday!\")))\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger2@mailjet.com\")\n                    .put(\"Name\", \"passenger 2\")));\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"/*\nThis call sends an email to 2 recipients with global and contact personalization.\n*/\npackage main\nimport (\n\t\"fmt\"\n\t. \"github.com/mailjet/mailjet-apiv3-go\"\n\t\"os\"\n)\ntype  MyVarsStruct  struct {\n  Day  string\n}\ntype MyRecipientsVarsStruct struct {\n  Day               string\n  Personalmessage   string\n}\nfunc main () {\n\tmailjetClient := NewMailjetClient(os.Getenv(\"MJ_APIKEY_PUBLIC\"), os.Getenv(\"MJ_APIKEY_PRIVATE\"))\n\temail := &InfoSendMail {\n      FromEmail: \"pilot@mailjet.com\",\n      FromName: \"Mailjet Pilot\",\n      Subject: \"Your email flight plan!\",\n      TextPart: \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n      HTMLPart: \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\",\n      Vars: MyVarsStruct {\n        Day: \"Monday\",\n      },\n      Recipients: []Recipient {\n        Recipient {\n          Email: \"passenger1@mailjet.com\",\n          Name: \"passenger 1\",\n          Vars: MyRecipientsVarsStruct {\n            Day: \"Tuesday\",\n            Personalmessage: \"Happy birthday!\",\n          },\n        },\n        Recipient {\n          Email: \"passenger2@mailjet.com\",\n          Name: \"passenger 2\",\n        },\n      },\n    }\n\tres, err := mailjetClient.SendMail(email)\n\tif err != nil {\n\t\t\tfmt.Println(err)\n\t} else {\n\t\t\tfmt.Println(\"Success\")\n\t\t\tfmt.Println(res)\n\t}\n}\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using Mailjet.Client;\nusing Mailjet.Client.Resources;\nusing System;\nusing Newtonsoft.Json.Linq;\nnamespace Mailjet.ConsoleApplication\n{\n   class Program\n   {\n      /// <summary>\n      /// This call sends an email to 2 recipients with global and contact personalization.\n      /// </summary>\n      static void Main(string[] args)\n      {\n         RunAsync().Wait();\n      }\n      static async Task RunAsync()\n      {\n         MailjetClient client = new MailjetClient(Environment.GetEnvironmentVariable(\"MJ_APIKEY_PUBLIC\"), Environment.GetEnvironmentVariable(\"MJ_APIKEY_PRIVATE\"));\n         MailjetRequest request = new MailjetRequest\n         {\n            Resource = Send.Resource,\n         }\n            .Property(Send.FromEmail, \"pilot@mailjet.com\")\n            .Property(Send.FromName, \"Mailjet Pilot\")\n            .Property(Send.Subject, \"Your email flight plan!\")\n            .Property(Send.TextPart, \"Dear passenger, welcome to Mailjet! On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\")\n            .Property(Send.HtmlPart, \"<h3>Dear passenger, welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> On this [[var:day]], may the delivery force be with you! [[var:personalmessage]]\")\n            .Property(Send.Vars, new JObject {\n                {\"day\", \"Monday\"}\n                })\n            .Property(Send.Recipients, new JArray {\n                new JObject {\n                 {\"Email\", \"passenger1@mailjet.com\"},\n                 {\"Name\", \"passenger 1\"},\n                 {\"Vars\", new JObject {\n                  {\"day\", \"Tuesday\"},\n                  {\"personalmessage\", \"Happy birthday!\"}\n                  }}\n                 },\n                new JObject {\n                 {\"Email\", \"passenger2@mailjet.com\"},\n                 {\"Name\", \"passenger 2\"}\n                 }\n                });\n         MailjetResponse response = await client.PostAsync(request);\n         if (response.IsSuccessStatusCode)\n         {\n            Console.WriteLine(string.Format(\"Total: {0}, Count: {1}\\n\", response.GetTotal(), response.GetCount()));\n            Console.WriteLine(response.GetData());\n         }\n         else\n         {\n            Console.WriteLine(string.Format(\"StatusCode: {0}\\n\", response.StatusCode));\n            Console.WriteLine(string.Format(\"ErrorInfo: {0}\\n\", response.GetErrorInfo()));\n            Console.WriteLine(string.Format(\"ErrorMessage: {0}\\n\", response.GetErrorMessage()));\n         }\n      }\n   }\n}\n","lang":"csharp"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-contact-properties","__idx":5},"children":["Use contact properties"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the contact you are sending an email to is already in Mailjet system with some contact datas, you can leverage this information to personalize your email."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[[data:METADATA_NAME]]"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[[data:METADATA_NAME:DEFAULT_VALUE]]"]}," to insert data in your content."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DEFAULT_VALUE"]}," is the default value that will be used if no data is found."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Refer to the Personalization section for more information on how to add contact properties."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-2","__idx":6},"children":["Example"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"# This call sends an email to the given recipient.\ncurl -s \\\n\t-X POST \\\n\t--user \"$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE\" \\\n\thttps://api.mailjet.com/v3/send \\\n\t-H 'Content-Type: application/json' \\\n\t-d '{\n\t\t\"FromEmail\":\"pilot@mailjet.com\",\n\t\t\"FromName\":\"Mailjet Pilot\",\n\t\t\"Subject\":\"Your email flight plan!\",\n\t\t\"Text-part\":\"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\",\n\t\t\"Html-part\":\"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\",\n\t\t\"Recipients\":[{\"Email\":\"passenger1@mailjet.com\",\"Name\":\"passenger 1\"},{\"Email\":\"passenger2@mailjet.com\",\"Name\":\"passenger 2\"}]\n\t}'\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PHP","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\nrequire 'vendor/autoload.php';\nuse \\Mailjet\\Resources;\n$mj = new \\Mailjet\\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));\n$body = [\n    'FromEmail' => \"pilot@mailjet.com\",\n    'FromName' => \"Mailjet Pilot\",\n    'Subject' => \"Your email flight plan!\",\n    'Text-part' => \"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\",\n    'Html-part' => \"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\",\n    'Recipients' => [\n        [\n            'Email' => \"passenger1@mailjet.com\",\n            'Name' => \"passenger 1\"\n        ],\n        [\n            'Email' => \"passenger2@mailjet.com\",\n            'Name' => \"passenger 2\"\n        ]\n    ]\n];\n$response = $mj->post(Resources::$Email, ['body' => $body]);\n$response->success() && var_dump($response->getData());\n?>\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Node.js","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"/**\n *\n * This call sends an email to one recipient.\n *\n */\nconst mailjet = require('node-mailjet').connect(\n  process.env.MJ_APIKEY_PUBLIC,\n  process.env.MJ_APIKEY_PRIVATE\n)\nconst request = mailjet.post('send').request({\n  FromEmail: 'pilot@mailjet.com',\n  FromName: 'Mailjet Pilot',\n  Subject: 'Your email flight plan!',\n  'Text-part':\n    'Dear [[data:firstname:\"passenger\"]], welcome to Mailjet! May the delivery force be with you!',\n  'Html-part':\n    '<h3>Dear [[data:firstname:\"passenger\"]], welcome to <a href=\"https://www.mailjet.com/\">Mailjet</a>!<br /> May the delivery force be with you!',\n  Recipients: [\n    { Email: 'passenger1@mailjet.com', Name: 'passenger 1' },\n    { Email: 'passenger2@mailjet.com', Name: 'passenger 2' },\n  ],\n})\nrequest\n  .then(result => {\n    console.log(result.body)\n  })\n  .catch(err => {\n    console.log(err.statusCode)\n  })\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Ruby","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"ruby","header":{"controls":{"copy":{}}},"source":"Mailjet.configure do |config|\n  config.api_key = ENV['MJ_APIKEY_PUBLIC']\n  config.secret_key = ENV['MJ_APIKEY_PRIVATE']\n  config.default_from = 'your default sending address'\nend\nvariable = Mailjet::Send.create(\n  from_email: 'pilot@mailjet.com',\n  from_name: 'Mailjet Pilot',\n  subject: 'Your email flight plan!',\n  text_part: 'Dear [[data:firstname: \"passenger\"]], welcome to Mailjet! May the delivery force be with you!',\n  html_part: '<h3>Dear [[data:firstname: \"passenger\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!',\n  recipients:[\n    {'Email':'passenger1@mailjet.com','Name':'passenger 1'},\n    {'Email':'passenger2@mailjet.com','Name':'passenger 2'}])\n","lang":"ruby"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from mailjet_rest import Client\nimport os\napi_key = os.environ['MJ_APIKEY_PUBLIC']\napi_secret = os.environ['MJ_APIKEY_PRIVATE']\nmailjet = Client(auth=(api_key, api_secret))\ndata = {\n\t\"FromEmail\":\"pilot@mailjet.com\",\n\t\"FromName\":\"Mailjet Pilot\",\n\t\"Subject\":\"Your email flight plan!\",\n\t\"Text-part\":\"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\",\n\t\"Html-part\":\"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\",\n\t\"Recipients\":[{\"Email\":\"passenger1@mailjet.com\",\"Name\":\"passenger 1\"},{\"Email\":\"passenger2@mailjet.com\",\"Name\":\"passenger 2\"}]\n}\nresult = mailjet.send.create(data=data)\nprint result.status_code\nprint result.json()\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"package MyClass;\nimport com.mailjet.client.errors.MailjetException;\nimport com.mailjet.client.errors.MailjetSocketTimeoutException;\nimport com.mailjet.client.MailjetClient;\nimport com.mailjet.client.MailjetRequest;\nimport com.mailjet.client.MailjetResponse;\nimport com.mailjet.client.resource.Email;\nimport org.json.JSONArray;\nimport org.json.JSONObject;\npublic class MyClass {\n    /**\n     * This call sends an email to the given recipient.\n     */\n    public static void main(String[] args) throws MailjetException, MailjetSocketTimeoutException {\n      MailjetClient client;\n      MailjetRequest request;\n      MailjetResponse response;\n      client = new MailjetClient(System.getenv(\"MJ_APIKEY_PUBLIC\"), System.getenv(\"MJ_APIKEY_PRIVATE\"));\n      request = new MailjetRequest(Email.resource)\n\t\t\t\t\t\t.property(Email.FROMEMAIL, \"pilot@mailjet.com\")\n\t\t\t\t\t\t.property(Email.FROMNAME, \"Mailjet Pilot\")\n\t\t\t\t\t\t.property(Email.SUBJECT, \"Your email flight plan!\")\n\t\t\t\t\t\t.property(Email.TEXTPART, \"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\")\n\t\t\t\t\t\t.property(Email.HTMLPART, \"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\")\n\t\t\t\t\t\t.property(Email.RECIPIENTS, new JSONArray()\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger1@mailjet.com\")\n                    .put(\"Name\", \"passenger 1\"))\n                .put(new JSONObject()\n                    .put(\"Email\", \"passenger2@mailjet.com\")\n                    .put(\"Name\", \"passenger 2\")));\n      response = client.post(request);\n      System.out.println(response.getStatus());\n      System.out.println(response.getData());\n    }\n}\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Go","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"go","header":{"controls":{"copy":{}}},"source":"/*\nThis call sends an email to the given recipient.\n*/\npackage main\nimport (\n\t\"fmt\"\n\t. \"github.com/mailjet/mailjet-apiv3-go\"\n\t\"os\"\n)\nfunc main () {\n\tmailjetClient := NewMailjetClient(os.Getenv(\"MJ_APIKEY_PUBLIC\"), os.Getenv(\"MJ_APIKEY_PRIVATE\"))\n\temail := &InfoSendMail {\n      FromEmail: \"pilot@mailjet.com\",\n      FromName: \"Mailjet Pilot\",\n      Subject: \"Your email flight plan!\",\n      TextPart: \"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\",\n      HTMLPart: \"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\",\n      Recipients: []Recipient {\n        Recipient {\n          Email: \"passenger1@mailjet.com\",\n          Name: \"passenger 1\",\n        },\n        Recipient {\n          Email: \"passenger2@mailjet.com\",\n          Name: \"passenger 2\",\n        },\n      },\n    }\n\tres, err := mailjetClient.SendMail(email)\n\tif err != nil {\n\t\t\tfmt.Println(err)\n\t} else {\n\t\t\tfmt.Println(\"Success\")\n\t\t\tfmt.Println(res)\n\t}\n}\n","lang":"go"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using Mailjet.Client;\nusing Mailjet.Client.Resources;\nusing System;\nusing Newtonsoft.Json.Linq;\nnamespace Mailjet.ConsoleApplication\n{\n   class Program\n   {\n      /// <summary>\n      /// This call sends an email to the given recipient.\n      /// </summary>\n      static void Main(string[] args)\n      {\n         RunAsync().Wait();\n      }\n      static async Task RunAsync()\n      {\n         MailjetClient client = new MailjetClient(Environment.GetEnvironmentVariable(\"MJ_APIKEY_PUBLIC\"), Environment.GetEnvironmentVariable(\"MJ_APIKEY_PRIVATE\"));\n         MailjetRequest request = new MailjetRequest\n         {\n            Resource = Send.Resource,\n         }\n            .Property(Send.FromEmail, \"pilot@mailjet.com\")\n            .Property(Send.FromName, \"Mailjet Pilot\")\n            .Property(Send.Subject, \"Your email flight plan!\")\n            .Property(Send.TextPart, \"Dear [[data:firstname:\\\"passenger\\\"]], welcome to Mailjet! May the delivery force be with you!\")\n            .Property(Send.HtmlPart, \"<h3>Dear [[data:firstname:\\\"passenger\\\"]], welcome to <a href=\\\"https://www.mailjet.com/\\\">Mailjet</a>!<br /> May the delivery force be with you!\")\n            .Property(Send.Recipients, new JArray {\n                new JObject {\n                 {\"Email\", \"passenger1@mailjet.com\"},\n                 {\"Name\", \"passenger 1\"}\n                 },\n                new JObject {\n                 {\"Email\", \"passenger2@mailjet.com\"},\n                 {\"Name\", \"passenger 2\"}\n                 }\n                });\n         MailjetResponse response = await client.PostAsync(request);\n         if (response.IsSuccessStatusCode)\n         {\n            Console.WriteLine(string.Format(\"Total: {0}, Count: {1}\\n\", response.GetTotal(), response.GetCount()));\n            Console.WriteLine(response.GetData());\n         }\n         else\n         {\n            Console.WriteLine(string.Format(\"StatusCode: {0}\\n\", response.StatusCode));\n            Console.WriteLine(string.Format(\"ErrorInfo: {0}\\n\", response.GetErrorInfo()));\n            Console.WriteLine(string.Format(\"ErrorMessage: {0}\\n\", response.GetErrorMessage()));\n         }\n      }\n   }\n}\n","lang":"csharp"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"go-further-with-personalization","__idx":7},"children":["Go further with personalization"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mailjet offers a Templating language that can extend the personalization of your transactional messages. Visit our Transactional templating guide to learn about additional substitutions, modification functions and conditional statements you can use to personalize your messages."]}]},"headings":[{"value":"Personalization","id":"personalization","depth":1},{"value":"Content Formatting","id":"content-formatting","depth":2},{"value":"Use vars and custom vars","id":"use-vars-and-custom-vars","depth":2},{"value":"Example","id":"example","depth":3},{"value":"Example","id":"example-1","depth":3},{"value":"Use contact properties","id":"use-contact-properties","depth":2},{"value":"Example","id":"example-2","depth":3},{"value":"Go further with personalization","id":"go-further-with-personalization","depth":2}],"frontmatter":{"title":"Mailjet Send API v3.0","seo":{"title":"Personalization - Mailjet Send API v3","description":"Personalize transactional emails in Mailjet Send API v3 using Vars and contact data with [[var:NAME]] placeholders, covering global and per-recipient overrides."}},"lastModified":"2026-08-26T10:53:57.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/email-api/send-api-v3/personalizationv3","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}