@cfxlabsinc/b2b-services
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Parameters

      • body: {
            asm?: { group_id: number; groups_to_display?: number[] };
            attachments?: {
                content: string;
                content_id?: string;
                disposition?: "inline" | "attachment";
                filename: string;
                type?: string;
            }[];
            batch_id?: string;
            categories?: string[];
            content?: { type: string; value: string }[];
            custom_args?: string;
            from: { email: string; name?: string };
            headers?: Record<string, never>;
            ip_pool_name?: string;
            mail_settings?: {
                bypass_bounce_management?: { enable?: boolean };
                bypass_list_management?: { enable?: boolean };
                bypass_spam_management?: { enable?: boolean };
                bypass_unsubscribe_management?: { enable?: boolean };
                footer?: { enable?: boolean; html?: string; text?: string };
                sandbox_mode?: { enable?: boolean };
            };
            personalizations: {
                bcc?: { email: string; name?: string }[];
                cc?: { email: string; name?: string }[];
                custom_args?: Record<string, never>;
                dynamic_template_data?: Record<string, never>;
                from?: { email: string; name?: string };
                headers?: Record<string, never>;
                send_at?: number;
                subject?: string;
                substitutions?: { [key: string]: string };
                to: { email: string; name?: string }[];
            }[];
            reply_to?: { email: string; name?: string };
            reply_to_list?: { email: string; name?: string }[];
            send_at?: number;
            subject?: string;
            template_id?: string;
            tracking_settings?: {
                click_tracking?: { enable?: boolean; enable_text?: boolean };
                ganalytics?: {
                    enable?: boolean;
                    utm_campaign?: string;
                    utm_content?: string;
                    utm_medium?: string;
                    utm_source?: string;
                    utm_term?: string;
                };
                open_tracking?: { enable?: boolean; substitution_tag?: string };
                subscription_tracking?: {
                    enable?: boolean;
                    html?: string;
                    substitution_tag?: string;
                    text?: string;
                };
            };
        }
        • Optionalasm?: { group_id: number; groups_to_display?: number[] }

          An object allowing you to specify how to handle unsubscribes. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. See Suppression Groups for more information.

          • group_id: number

            The unsubscribe group to associate with this email. See the Suppressions API to manage unsubscribe group IDs.

          • Optionalgroups_to_display?: number[]

            An array containing the unsubscribe groups that you would like to be displayed to a recipient on the unsubscribe preferences page. This page is displayed in the recipient's browser when they click the unsubscribe link in your message.

        • Optionalattachments?: {
              content: string;
              content_id?: string;
              disposition?: "inline" | "attachment";
              filename: string;
              type?: string;
          }[]

          An array of objects where you can define any attachments to be included with the message. Each object contains a content property, which must be a Base64 encoded string of the attachment itself, and type, filename, disposition, and content_id properties that tell SendGrid how to handle the attachment.

        • Optionalbatch_id?: string

          An ID representing a batch of emails to be sent at the same time. Including a batch_id in your request allows you to include this email in that batch. It also enables you to cancel or pause the delivery of that batch. See the Scheduled Sends API for more information about scheduling your email.

        • Optionalcategories?: string[]

          An array of category names assigned to this message. Categories allow you to group messages by categories you define. Categories should be used sparingly to create general groups that are relevant to you. Categories are not meant to be used to track individual mail sends. For more granular categorization and tracking, use the custom_args property. A category name cannot exceed 255 characters. See Working with Categories for more information.

        • Optionalcontent?: { type: string; value: string }[]

          An array of objects, each containing a message body's content and MIME type. You must specify at least one MIME type and may include multiple. To include more than one MIME type, add an object for each type to the array.

        • Optionalcustom_args?: string

          Values that are specific to the entire send that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This parameter is overridden by custom_args set at the personalizations level. Total custom_args size may not exceed 10,000 bytes.

        • from: { email: string; name?: string }
          • email: string

            Format: email

            The email address from which messages are sent. This address should be a verified sender in your Twilio SendGrid account. Email addresses specified in personalizations will override addresses set at the message level outside of the personalizations object.

          • Optionalname?: string

            A name or title associated with the email address such as "Support" or "Alex".

        • Optionalheaders?: Record<string, never>

          A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: x-sg-id, x-sg-eid, received, dkim-signature, Content-Type, Content-Transfer-Encoding, To, From, Subject, Reply-To, CC, BCC.

        • Optionalip_pool_name?: string

          The IP Pool that you would like to send this email from. IP Pools allow you to group your dedicated Twilio SendGrid IP addresses in order to have more control over your deliverability. See IP Pools for more information.

        • Optionalmail_settings?: {
              bypass_bounce_management?: { enable?: boolean };
              bypass_list_management?: { enable?: boolean };
              bypass_spam_management?: { enable?: boolean };
              bypass_unsubscribe_management?: { enable?: boolean };
              footer?: { enable?: boolean; html?: string; text?: string };
              sandbox_mode?: { enable?: boolean };
          }

          A collection of different mail settings that you can use to specify how you would like this email to be handled. Mail settings provide extra functionality to your mail send. See Mail Settings for more information.

          • Optionalbypass_bounce_management?: { enable?: boolean }

            Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the bypass_list_management filter. See the the "Bypass suppressions" section of our Suppressions Overview for more about bypass filters.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

          • Optionalbypass_list_management?: { enable?: boolean }

            Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See the the "Bypass suppressions" section of our Suppressions Overview for more about bypass filters.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

          • Optionalbypass_spam_management?: { enable?: boolean }

            Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the bypass_list_management filter. See the the "Bypass suppressions" section of our Suppressions Overview for more about bypass filters.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

          • Optionalbypass_unsubscribe_management?: { enable?: boolean }

            Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the bypass_list_management filter. See the the "Bypass suppressions" section of our Suppressions Overview for more about bypass filters.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

          • Optionalfooter?: { enable?: boolean; html?: string; text?: string }

            Inserts a custom footer at the bottom of the text and HTML bodies of your messages. Use the html and text properties to include the content of the footers to be inserted.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

            • Optionalhtml?: string

              The HTML content of your footer.

            • Optionaltext?: string

              The plain text content of your footer.

          • Optionalsandbox_mode?: { enable?: boolean }

            Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

        • personalizations: {
              bcc?: { email: string; name?: string }[];
              cc?: { email: string; name?: string }[];
              custom_args?: Record<string, never>;
              dynamic_template_data?: Record<string, never>;
              from?: { email: string; name?: string };
              headers?: Record<string, never>;
              send_at?: number;
              subject?: string;
              substitutions?: { [key: string]: string };
              to: { email: string; name?: string }[];
          }[]

          An array of messages and their metadata. Each object within the personalizations array can be thought of as a mail envelope—it defines who should receive an individual message and how that message should be handled. See Personalizations for more information.

        • Optionalreply_to?: { email: string; name?: string }
          • email: string

            Format: email

            An email address to which a message is sent. Email addresses specified in personalizations will override addresses set at the message level outside of the personalizations object.

          • Optionalname?: string

            A name or title associated with the email address such as "Alex".

        • Optionalreply_to_list?: { email: string; name?: string }[]

          An array of recipients to whom replies will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. You can use either the reply_to property or reply_to_list property but not both.

        • Optionalsend_at?: number

          A unix timestamp allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. This property may be overridden by the send_at property set at the personalizations level.

        • Optionalsubject?: string

          The global or message level subject of your email. Subject lines set in personalizations objects will override this global subject line. See line length limits specified in RFC 2822 for guidance on subject line character limits.

        • Optionaltemplate_id?: string

          An email template ID. A template that contains a subject and content—either text or html—will override any subject and content values specified at the personalizations or message level. If a template ID begins with d-, it is a dynamic template and will work with the dynamic_template_data property. If the template ID does not begin with d-, it is a standard SendGrid template and will work with the substitutions property. See How to Send an Email with Dynamic Templates for more information about working with templates.

        • Optionaltracking_settings?: {
              click_tracking?: { enable?: boolean; enable_text?: boolean };
              ganalytics?: {
                  enable?: boolean;
                  utm_campaign?: string;
                  utm_content?: string;
                  utm_medium?: string;
                  utm_source?: string;
                  utm_term?: string;
              };
              open_tracking?: { enable?: boolean; substitution_tag?: string };
              subscription_tracking?: {
                  enable?: boolean;
                  html?: string;
                  substitution_tag?: string;
                  text?: string;
              };
          }

          Settings to determine how you would like to track the metrics of how your recipients interact with your email. See Tracking Settings for more information.

          • Optionalclick_tracking?: { enable?: boolean; enable_text?: boolean }

            Allows you to track if a recipient clicked a link in your email.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

            • Optionalenable_text?: boolean

              Indicates if this setting should be included in the text/plain portion of your email.

          • Optionalganalytics?: {
                enable?: boolean;
                utm_campaign?: string;
                utm_content?: string;
                utm_medium?: string;
                utm_source?: string;
                utm_term?: string;
            }

            Allows you to enable tracking provided by Google Analytics. See Google Analytics and SendGrid Statistics for more information about this property.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

            • Optionalutm_campaign?: string

              The name of the campaign.

            • Optionalutm_content?: string

              Used to differentiate your campaign from advertisements.

            • Optionalutm_medium?: string

              Name of the marketing medium. (e.g., Email)

            • Optionalutm_source?: string

              Name of the referrer source. (e.g., Google, SomeDomain.com, or Marketing Email)

            • Optionalutm_term?: string

              Used to identify any paid keywords.

          • Optionalopen_tracking?: { enable?: boolean; substitution_tag?: string }

            Allows you to track if the email was opened by including a single transparent pixel image in the body of the message content. When the message is opened, a request for the pixel is sent. That request indicates to Twilio SendGrid that the message was opened.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

            • Optionalsubstitution_tag?: string

              Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel.

          • Optionalsubscription_tracking?: { enable?: boolean; html?: string; substitution_tag?: string; text?: string }

            Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the substitution_tag property.

            • Optionalenable?: boolean

              Indicates if this setting is enabled.

            • Optionalhtml?: string

              HTML to be appended to the email with the subscription tracking link.

            • Optionalsubstitution_tag?: string

              A tag that will be replaced with the unsubscribe URL. If this property is used, it will override both the text and html properties. The URL of the link will be placed at the substitution tag's location in the message body with no additional formatting.

            • Optionaltext?: string

              Text to be appended to the email with the subscription tracking link.

      Returns Promise<void>