Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          sendEmailAsync(emailObject)

          sendEmailAsync(emailObject)

          You can now send emails from within the Consumer Goods (CG) Cloud offline mobile app. Using this method opens the compose view of the email client on the device. If more than one email client is registered, then the user is given an option to choose the email client.

          Required Editions

          Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          The user can click the email button next to the email address, which can be preset in the Customer module of the application. It opens the email client that has been installed on the mobile device with the specified email id. The email button is included in a Merger control.

          The PhoneGap plugin provides the email functionality. The customizer calls sendEmailAsync() from the Facade API.

          Parameters

          emailObject(Object)(Optional): An object containing the values for the following properties - toRecipients, ccRecipients, bccRecipients, subject, body.

          Returns

          result(promise): The API returns a promise.

          Examples

          
          Facade.sendEmailAsync();
          Facade.sendEmailAsync({toRecipients: "example@example.com"});
          Facade.sendEmailAsync({toRecipients: "example@example.com", subject: "Hi"});
          Facade.sendEmailAsync({toRecipients: "example@example.com", subject: "Hi", body: "Hello World"});
          

          You can validate whether the same email ID you see in the app is used by the startPhoneCall(dial) method, by clicking the Email icon and checking the Email Details dialog.

          Sample Code

          
          <Action name="sendMail" actionType="LOGIC" call="ProcessContext::integration.sendMail">
             <Parameters>
                <Input name="myRec" value="ProcessContext::myRecipients"/>
                <Input name="myCC" value="ProcessContext::myCC"/>
                <Input name="myBCC" value="ProcessContext::myBCC"/>
                <Input name="mySub" value="ProcessContext::mySubject"/>
                <Input name="myBod" value="ProcessContext::myBody"/>
             </Parameters>  
          </Action>
          
           
          Loading
          Salesforce Help | Article