Contents
How to create activity in Apex?
insert new Task( Subject = ‘Subject: Test email….’, WhoId = myContact.Id, WhatId = myOpportunity.Id, TaskSubtype = ‘Email’, ActivityDate = Date….Records shown as Activities in Salesforce are one of three kinds of sObject:
- Task (Log a Call, follow-up Tasks)
- Event (calendar events)
- EmailMessage + Task (emails)
How to send email notification through Apex in salesforce?
Create a new template: Go to Setup-> search ‘template’ -> choose ‘Classic Email Templates’-> click on ‘New Template’ button. Select Visualforce option for ‘type of email template’. Enter template name, keep the other defaults. For this example we use ‘Test Account Alert Email’.
How do I create an activity record in Salesforce?
How to Create a Task in Salesforce
- Enter a name in the Search bar for the record to which you want to link the task and click the Search button.
- Click the name of the record you want.
- Select Create New Task from the sidebar or click the New Task button on the Open Activities related list of a record, as shown.
How does apex-SMS-magic send SMS messages?
SMS-Magic provides a custom trigger that will (a) execute after insertion of the record and (b) send out messages to the Mobile Number. The trigger will also populate other fields in the SMS History object instance with default values. This sample code sends an SMS messages.
How to create an email template in apex?
Following steps help with implementation email notification feature in apex using the predefined templates. Go to Setup-> search ‘template’ -> choose ‘Classic Email Templates’-> click on ‘New Template’ button. Select Visualforce option for ‘type of email template’. Enter template name, keep the other defaults.
How to send and log email alerts as an activity?
GravityLab is an NZ Salesforce partner and have created an app that allows you to use that Apex code with the simplicity of an Email Alert. You can call it from process builder or flows, pass through the relevant recipient id and email template, and the email is sent with the activity logged.
How to send and record email alerts in Salesforce?
One of the most popular ideas in the Salesforce community, outstanding for 11 years with 47,300 Points and 4,750 Votes, is the ability to send an email alert and record it in the activity history. There are workarounds available, such as saving a completed task, but none of these saves the specific content of the email.