Compose an email

Purpose

This command is used to perform actions associated with composing an email.

Request URL 

Compose new mail

This command can be used to compose a new email with the provided details like To, Subject, Content etc

clientsdk.dispatch("compose", {}).then(function(mailObj){ });

Insert mail content

This command is used to insert content into a new email or into an email you are already composing.

clientsdk.dispatch("compose", { mode: "insert", mailData:"Hi" });

Append mail content

This command is used to append content into a new email or into an email you are already composing but mostly used when you want to append a footer or header to all the email that's sent.

clientsdk.dispatch("compose", { mode: "insert", position: "append", mailData:"Footer content"});

Insert HTML

This command is used to insert an HTML into a new email or into an email you are already composing.

clientsdk.dispatch("compose", { mode: "insertHtml", mailData:"<b>Bold text</b" });

Sample Request - Compose new mail

Copiedclientsdk.dispatch("compose", { mailData: { SUBJECT:"Sales Pitch", TO:"charles@zylker.com", CC : "paula@zylker.com" CONTENT: "Hi, This is regarding the sales pitch we had discussed about previously." }}).then(function(mailObj){ });

Sample Request - Insert mail content

Copiedclientsdk.dispatch("compose", { mode: "insert", mailData:"Hi, This is regarding the sales pitch we had discussed about previously." });

Sample Request - Append mail content

Copiedclientsdk.dispatch("compose", { mode: "insert", mailData:"Hi, This is regarding the sales pitch we had discussed about previously." });

Sample Request - Insert mail HTML

Copiedclientsdk.dispatch("compose", { mode: "insertHtml", mailData:"<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Meeting Request</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Arial, sans-serif;
            background-color: #f8fafc;
            color: #334155;
            -webkit-text-size-adjust: 100%;
        }
        table {
            border-spacing: 0;
            border-collapse: collapse;
            width: 100%;
        }
        .wrapper {
            width: 100%;
            table-layout: fixed;
            background-color: #f8fafc;
            padding: 40px 0;
        }
        .main-table {
            background-color: #ffffff;
            margin: 0 auto;
            max-width: 500px;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        }
        .button {
            background-color: #2563eb;
            color: #ffffff !important;
            text-decoration: none;
            padding: 12px 28px;
            border-radius: 6px;
            display: inline-block;
            font-weight: 600;
            font-size: 15px;
        }
        @media screen and (max-width: 520px) {
            .wrapper { padding: 16px 0; }
            .content-padding { padding: 30px 24px !important; }
        }
    </style>
</head>
<body>
    <center class="wrapper">
        <table class="main-table" role="presentation">
            <tr>
                <td class="content-padding" style="padding: 40px; font-size: 16px; line-height: 1.6;">
                    <p style="margin-top: 0; margin-bottom: 16px;">Hello,</p>
                    
                    <p style="margin-bottom: 24px;">Hope you're doing good. Let's meet tomorrow at <strong>12:30 PM</strong>.</p>
                    <p style="margin-bottom: 0; color: #64748b; font-size: 15px;">Best regards,</p>
                  <p style="margin-bottom: 0; color: #64748b; font-size: 15px;">Rebecca Anderson,</p>
                </td>
            </tr>
        </table>
    </center>
</body>
</html>
" });