Mailchimp Developer LogoMailchimp Developer Wordmark

Transactional API

  • Allowlists

    Add, list, or delete from your Rejection Allowlist.

    • Exports

      Start an export, or get information on export jobs in progress.

      • IPs

        Request and manage Dedicated IPs for your account, and set up reverse DNS.

        • Inbound

          Manage your inbound domains and routes.

          • Messages

            Send, schedule, or get information on your emails.

            • Metadata

              Manage your custom metadata fields in your account.

              • Rejects

                Add, list, or delete from your Rejection Denylist.

                • Senders

                  Manage or get information about your sending domains.

                  • Subaccounts

                    Manage your subaccounts, including the abilitiy to pause and resume sending.

                    • Tags

                      List, delete, or get information on your Tags and their sending statistics.

                      • Templates

                        Manage the Templates in your account.

                        • Render html template

                          post

                          /templates/render

                          Inject content and optionally merge fields into a template, returning the HTML that results.

                          body parameters

                          • keyrequired
                            string

                            a valid api key

                          • template_namerequired
                            string

                            the immutable name of a template that exists in the user's account

                          • template_contentrequired
                            object[]

                            an array of template content to render. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

                            Show Properties
                          • merge_vars
                            object[]

                            optional merge variables to use for injecting merge field content. If this is not provided, no merge fields will be replaced.

                            Show Properties

                          Render html template

                          const mailchimpClient = require("@mailchimp/mailchimp_transactional")(
                            "YOUR_API_KEY"
                          );
                          
                          const run = async () => {
                            const response = await mailchimpClient.templates.render({
                              template_name: "template_name",
                              template_content: [{ name: "name", content: "content" }],
                            });
                            console.log(response);
                          };
                          
                          run();
                          
                          

                          Success Response

                          • HTTP Status 200

                            the result of rendering the given template with the content and merge field values injected

                            • html
                              string

                              the rendered HTML as a string

                          Example response

                          JSON
                          {
                            "html": "string"
                          }
                        • URLs

                          Manage your tracking domains. Some of these endpoints may be deprecated.

                          • Users

                            Get information about your account, or ping Transactional.

                            • Webhooks

                              Manage the webhooks in your account.

                              • Whitelists

                                Add, list, or delete from your Rejection Allowlist. These endpoints are being replaced with a series of functionally identical endpoints called /allowlists.