Add Contacts through Lead Squared on Mailmodo
Last updated May 12, 2025
In this article we will see how to add leads as contact in Mailmodo by LeadSquared.
LeadSquared Setup
Step 1: Navigate to the Manage Lapps page in the Apps section of the main navigation panel.
Step 2: On the Manage Lapps page, click the Create Lapp button.
Step 3: Enter a name and description for the Lapp.
Step 4: Select the Coding Mode as Editor (write your code directly in the Lapps code editor).
function main(queryString, body, callback) {
ls.log.Info('Lapp called');
const email = body.Current.EmailAddress;
const first_name = body.Current.FirstName;
const addToList = {
url: `https://api.mailmodo.com/api/v1/addToList`,
body: {
email,
data: {
'Full Name' : first_name
},
listName: 'LSQ_Database'
},
headers: {
'Content-Type': 'application/json',
'mmApiKey': 'PUT API KEY HERE'
},
json: true,
};
request.post(addToList, function(error, response, body) {
ls.log.Info('Contact added to Mailmodo: ', response);
if (error) {
ls.log.Error('Contact addition to Mailmodo failed: ', error);
callback(error, null);
}
});
ls.log.Info('Done');
}
**Please update mmapikey value as mentioned under API key in your account settings Step 5: Publish the Lapp to configure it with the workflow.
Step 6: Navigate to Marketing>Automation and click Create Automation.
Step 7: After selecting an automation trigger, under the Custom Action, click Call Lapp.
Step 8: In the Call Lapp pop-up, search for your Lapp.
- Choose the Environment as live or test.
- Use the Query String field if you wish to pass additional data to the Lapp in the form of key-value pairs.
- Set the Save Response option to Yes if you want to save the Lapp response and use it to send emails with dynamic content.
Step 9: Click Save when you’re done.