Gathering detailed insights and metrics for mailersend
Gathering detailed insights and metrics for mailersend
Gathering detailed insights and metrics for mailersend
Gathering detailed insights and metrics for mailersend
npm install mailersend
Typescript
Module System
Node Version
NPM Version
59.2
Supply Chain
99
Quality
76.9
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
1,692,825
Last Day
721
Last Week
12,780
Last Month
77,134
Last Year
953,163
138 Stars
190 Commits
19 Forks
10 Watching
12 Branches
21 Contributors
Latest Version
2.3.0
Package Id
mailersend@2.3.0
Unpacked Size
220.25 kB
Size
24.14 kB
File Count
103
NPM Version
6.14.18
Node Version
14.21.3
Publised On
30 Aug 2024
Cumulative downloads
Total Downloads
Last day
-15.7%
721
Compared to previous day
Last week
-38%
12,780
Compared to previous week
Last month
-9.5%
77,134
Compared to previous month
Last year
74.9%
953,163
Compared to previous year
3
MailerSend Node.js SDK
Send emails and SMS in minutes
Developers come for the high deliverability, and stay because our intuitive API and built-in integrations make life easier. 🤝
For more info, you can:
1npm install mailersend
if you would like to use the env approach as shown in the examples, please run
1npm install dotenv --save
1import 'dotenv/config';
2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";
3
4const mailerSend = new MailerSend({
5 apiKey: process.env.API_KEY,
6});
7
8const sentFrom = new Sender("you@yourdomain.com", "Your name");
9
10const recipients = [
11 new Recipient("your@client.com", "Your Client")
12];
13
14const emailParams = new EmailParams()
15 .setFrom(sentFrom)
16 .setTo(recipients)
17 .setReplyTo(sentFrom)
18 .setSubject("This is a Subject")
19 .setHtml("<strong>This is the HTML content</strong>")
20 .setText("This is the text content");
21
22await mailerSend.email.send(emailParams);
23
1import 'dotenv/config'; 2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const sentFrom = new Sender("bbbb@yourdomain.com", "Your name"); 9 10const recipients = [ 11 new Recipient("your@client.com", "Your Client") 12]; 13const cc = [ 14 new Recipient("your_cc@client.com", "Your Client CC") 15]; 16const bcc = [ 17 new Recipient("your_bcc@client.com", "Your Client BCC") 18]; 19 20const emailParams = new EmailParams() 21 .setFrom(sentFrom) 22 .setTo(recipients) 23 .setCc(cc) 24 .setBcc(bcc) 25 .setSubject("This is a Subject") 26 .setHtml("<strong>This is the HTML content</strong>") 27 .setText("This is the text content"); 28 29await mailerSend.email.send(emailParams);
1import 'dotenv/config';
2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";
3
4const mailerSend = new MailerSend({
5 apiKey: process.env.API_KEY,
6});
7
8const sentFrom = new Sender("you@yourdomain.com", "Your name");
9
10const recipients = [
11 new Recipient("your@client.com", "Your Client")
12];
13
14const emailParams = new EmailParams()
15 .setFrom(sentFrom)
16 .setTo(recipients)
17 .setReplyTo(sentFrom)
18 .setSubject("This is a Subject")
19 .setTemplateId('templateId');
20
21await mailerSend.email.send(emailParams);
22
1import 'dotenv/config'; 2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const sentFrom = new Sender("you@yourdomain.com", "Your name"); 9 10const recipients = [ 11 new Recipient("your@client.com", "Your Client") 12]; 13 14const personalization = [ 15 { 16 email: "your@client.com", 17 data: { 18 test: 'Test Value' 19 }, 20 } 21]; 22 23const emailParams = new EmailParams() 24 .setFrom(sentFrom) 25 .setTo(recipients) 26 .setReplyTo(sentFrom) 27 .setPersonalization(personalization) 28 .setSubject("Subject, {{ test }}") 29 .setHtml("This is the HTML content, {{ test }}") 30 .setText("This is the text content, {{ test }}"); 31 32await mailerSend.email.send(emailParams); 33
1import 'dotenv/config'; 2import fs from "fs"; 3import { MailerSend, EmailParams, Sender, Recipient, Attachment } from "mailersend"; 4 5const mailerSend = new MailerSend({ 6 apiKey: process.env.API_KEY, 7}); 8 9const sentFrom = new Sender("you@yourdomain.com", "Your name"); 10 11const recipients = [ 12 new Recipient("your@client.com", "Your Client") 13]; 14 15const attachments = [ 16 new Attachment( 17 fs.readFileSync('/path/to/file.pdf', { encoding: 'base64' }), 18 'file.pdf', 19 'attachment' 20 ) 21] 22 23const emailParams = new EmailParams() 24 .setFrom(sentFrom) 25 .setTo(recipients) 26 .setReplyTo(sentFrom) 27 .setAttachments(attachments) 28 .setSubject("This is a Subject") 29 .setHtml("<strong>This is the HTML content</strong>") 30 .setText("This is the text content"); 31 32await mailerSend.email.send(emailParams); 33
1import 'dotenv/config'; 2import fs from "fs"; 3import { MailerSend, EmailParams, Sender, Recipient, Attachment } from "mailersend"; 4 5const mailerSend = new MailerSend({ 6 apiKey: process.env.API_KEY, 7}); 8 9const sentFrom = new Sender("you@yourdomain.com", "Your name"); 10 11const recipients = [ 12 new Recipient("your@client.com", "Your Client") 13]; 14 15const attachments = [ 16 new Attachment( 17 fs.readFileSync('/path/to/file.png', { encoding: 'base64' }), 18 'file.png', 19 'inline', 20 '0123456789' 21 ) 22] 23 24const emailParams = new EmailParams() 25 .setFrom(sentFrom) 26 .setTo(recipients) 27 .setReplyTo(sentFrom) 28 .setAttachments(attachments) 29 .setSubject("This is a Subject") 30 .setHtml("<strong>This is the HTML content with an inline image attachment <img src=\"cid:0123456789\"/></strong>") 31 .setText("This is the text content"); 32 33await mailerSend.email.send(emailParams); 34
1import 'dotenv/config';
2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";
3
4const mailerSend = new MailerSend({
5 apiKey: process.env.API_KEY,
6});
7
8const sentFrom = new Sender("you@yourdomain.com", "Your name");
9
10const recipients = [
11 new Recipient("your@client.com", "Your Client")
12];
13
14const emailParams = new EmailParams()
15 .setFrom(sentFrom)
16 .setTo(recipients)
17 .setReplyTo(sentFrom)
18 .setSubject("This is a scheduled Subject")
19 .setHtml("<strong>This is a scheduled HTML content</strong>")
20 .setText("This is a scheduled text content")
21 .setSendAt(Math.floor((new Date(Date.now()+ 30*60*1000)).getTime() / 1000)); //send in 30mins NB:param has to be a Unix timestamp e.g 2443651141
22
23await mailerSend.email.send(emailParams);
24
1import 'dotenv/config';
2import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";
3
4const mailerSend = new MailerSend({
5 apiKey: process.env.API_KEY,
6});
7
8const sentFrom = new Sender("your@yourdomain.com", "Your name");
9
10const bulkEmails = [];
11
12const emailParams = new EmailParams()
13 .setFrom(sentFrom)
14 .setTo([
15 new Recipient("your@client.com", "Your Client")
16 ])
17 .setSubject("This is a Subject")
18 .setHtml("<strong>This is the HTML content</strong>")
19 .setText("This is the text content");
20
21bulkEmails.push(emailParams);
22
23const emailParams2 = new EmailParams()
24 .setFrom(sentFrom)
25 .setTo([
26 new Recipient("your_2@client.com", "Your Client 2")
27 ])
28 .setSubject("This is a Subject 2")
29 .setHtml("<strong>This is the HTML content 2</strong>")
30 .setText("This is the text content 2");
31
32bulkEmails.push(emailParams2);
33
34await mailerSend.email.sendBulk(bulkEmails);
35
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.getBulkStatus('bulk_email_id') // bulk email Id e.g 63af1fdb790d97105a090001 9 .then((response) => { 10 console.log(response.body); 11 }); 12
1import 'dotenv/config'; 2import { MailerSend, Token} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const token = new Token() 9 .setName("Token name") 10 .setDomainId("domain_id") 11 .setScopes([ 12 "email_full", 13 "domains_read", 14 "domains_full", 15 "activity_read", 16 "activity_full", 17 "analytics_read", 18 "analytics_full", 19 "tokens_full", 20 ]); 21 22mailerSend.token.create(token) 23 .then((response) => console.log(response.body)) 24 .catch((error) => console.log(error.body)); 25
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.token.updateSettings("token_id", { 9 status: "pause", 10}) 11 .then((response) => console.log(response.body)) 12 .catch((error) => console.log(error.body)); 13
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.token.delete("token_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, ActivityEventType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const queryParams = { 9 limit: 10, // Min: 10, Max: 100, Default: 25 10 page: 2, 11 date_from: 1443651141, // Unix timestamp 12 date_to: 1443651141, // Unix timestamp 13 event: [ActivityEventType.SENT, ActivityEventType.SOFT_BOUNCED] 14} 15 16mailerSend.email.activity.domain("domain_id", queryParams) 17 .then((response) => console.log(response.body)) 18 .catch((error) => console.log(error)); 19
1import 'dotenv/config'; 2import { ActivityEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.analytics.byDate({ 9 date_from: 1443651141, 10 date_to: 2443651141, 11 event: [ActivityEventType.CLICKED, ActivityEventType.OPENED], 12}).then(response => { 13 console.log(response.body); 14}).catch(error => { 15 console.log(error.body); 16}); 17
1import 'dotenv/config'; 2import { ActivityEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.analytics.byCountry({ 9 date_from: 1443651141, 10 date_to: 2443651141, 11}).then(response => { 12 console.log(response.body); 13}).catch(error => { 14 console.log(error.body); 15}); 16
1import 'dotenv/config'; 2import { ActivityEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.analytics.byUserAgent({ 9 date_from: 1443651141, 10 date_to: 2443651141, 11}).then(response => { 12 console.log(response.body); 13}).catch(error => { 14 console.log(error.body); 15}); 16
1import 'dotenv/config'; 2import { ActivityEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.analytics.byReadingEnvironment({ 9 date_from: 1443651141, 10 date_to: 2443651141, 11}).then(response => { 12 console.log(response.body); 13}).catch(error => { 14 console.log(error.body); 15}); 16
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.list() 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.single("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.delete("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.recipients("domain_id", { 9 page: 1, 10 limit: 10 11}) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config';
2import { MailerSend } from "mailersend";
3
4const mailerSend = new MailerSend({
5 apiKey: process.env.API_KEY,
6});
7
8mailerSend.email.domain.updateSettings("domain_id", {
9 send_paused: 1,
10 track_clicks: 1,
11 track_opens: 1,
12 track_unsubscribe: 1,
13 track_unsubscribe_html: "<strong> Unsubscribe now </strong>",
14 track_unsubscribe_plain: "Unsubscribe now",
15 track_content: 1,
16 custom_tracking_enabled: 1,
17 custom_tracking_subdomain: "subdomain",
18 precedence_bulk: 1,
19 ignore_duplicated_recipients: 1,
20})
21 .then((response) => console.log(response.body))
22 .catch((error) => console.log(error.body));
23
1import 'dotenv/config'; 2import { MailerSend, Domain } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const domain = new Domain({ 9 name: "example.com", 10 returnPathSubdomain: "rp_subdomain", 11 customTrackingSubdomain: "ct_subdomain", 12 inboundRoutingSubdomain: "ir_subdomain", 13}) 14 15mailerSend.email.domain.create(domain) 16 .then((response) => console.log(response.body)) 17 .catch((error) => console.log(error.body)); 18
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.dns("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.domain.verify("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.identity.list() 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.identity.single("identity_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.identity.singleByEmail('email_address') 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, Inbound, InboundFilterType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const identity = new Identity() 9 .setDomainId('domain_id') 10 .setEmail('identity@yourdomain.com') 11 .setName('Name') 12 .setReplyToEmail('reply_identity@yourdomain.com') 13 .setReplyToName('Reply Name') 14 .setAddNote(false); 15 16mailerSend.email.identity.create(identity) 17 .then((response) => console.log(response.body)) 18 .catch((error) => console.log(error.body)); 19
1import 'dotenv/config'; 2import { MailerSend, Inbound, InboundFilterType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const data = { 9 domain_id: 'string', 10 email: 'email@yourdomain.com', 11 name: 'name', 12 personal_note: 'Personal note', 13 reply_to_name: 'Reply Name', 14 reply_to_email: 'repy@yourdomain.com', 15 add_note: true, 16}; 17 18mailerSend.email.identity.update('identiy_id', data) 19 .then((response) => console.log(response.body)) 20 .catch((error) => console.log(error.body)); 21
1import 'dotenv/config'; 2import { MailerSend, Inbound, InboundFilterType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const data = { 9 domain_id: 'string', 10 email: 'email@yourdomain.com', 11 name: 'name', 12 personal_note: 'Personal note', 13 reply_to_name: 'Reply Name', 14 reply_to_email: 'repy@yourdomain.com', 15 add_note: true, 16}; 17 18mailerSend.email.identity.updateByEmail('email_address', data) 19 .then((response) => console.log(response.body)) 20 .catch((error) => console.log(error.body)); 21
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.identity.delete("identity_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.identity.deleteByEmail('email_address') 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.inbound.list() 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.inbound.single("inbound_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, Inbound, InboundFilterType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const inbound = new Inbound() 9 .setDomainId('domain_id') 10 .setName('inbound test') 11 .setDomainEnabled(true) 12 .setMatchFilter({ 13 type: InboundFilterType.MATCH_ALL, 14 }) 15 .setForwards([ 16 { 17 type: "webhook", 18 value: "https://www.yourdomain.com/hook" 19 } 20 ]); 21 22mailerSend.email.inbound.create(inbound) 23 .then((response) => console.log(response.body)) 24 .catch((error) => console.log(error.body)); 25
1import 'dotenv/config'; 2import { MailerSend, Inbound, InboundFilterType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const inbound = new Inbound() 9 .setDomainId('domain_id') 10 .setName('inbound test 2') 11 .setDomainEnabled(false) 12 .setMatchFilter({ 13 type: InboundFilterType.MATCH_ALL, 14 }) 15 .setForwards([ 16 { 17 type: "webhook", 18 value: "https://www.yourdomain.com/hook" 19 } 20 ]); 21 22mailerSend.email.inbound.update('inbound_id', inbound) 23 .then((response) => console.log(response.body)) 24 .catch((error) => console.log(error.body)); 25
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.inbound.delete("inbound_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8 9mailerSend.email.message.list() 10 .then((response) => console.log(response.body)) 11 .catch((error) => console.log(error.body)); 12
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.message.single("message_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.schedule.list() 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.schedule.single("message_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.schedule.delete("message_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.list({ 9 domain_id: "domain_id", 10 limit: 10, 11}) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.single("recipient_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.delete("recipient_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockRecipients({ 9 domain_id: 'domain_id', 10 recipients: [ 11 "test@example.com" 12 ] 13}, BlockListType.BLOCK_LIST) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockRecipients({ 9 domain_id: 'domain_id', 10 recipients: [ 11 "test@example.com" 12 ] 13}, BlockListType.HARD_BOUNCES_LIST) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockRecipients({ 9 domain_id: 'domain_id', 10 recipients: [ 11 "test@example.com" 12 ] 13}, BlockListType.SPAM_COMPLAINTS_LIST) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockRecipients({ 9 domain_id: 'domain_id', 10 recipients: [ 11 "test@example.com" 12 ] 13}, BlockListType.UNSUBSCRIBES_LIST) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { BlockListType, MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockList( 9 { domain_id: "domain_id", }, 10 BlockListType.BLOCK_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockList( 9 { domain_id: "domain_id", }, 10 BlockListType.HARD_BOUNCES_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockList( 9 { domain_id: "domain_id", }, 10 BlockListType.SPAM_COMPLAINTS_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.blockList( 9 { domain_id: "domain_id", }, 10 BlockListType.UNSUBSCRIBES_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.delBlockListRecipients( 9 ["recipient_id", "recipient_id"], 10 BlockListType.BLOCK_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.delBlockListRecipients( 9 ["recipient_id", "recipient_id"], 10 BlockListType.HARD_BOUNCES_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.delBlockListRecipients( 9 ["recipient_id", "recipient_id"], 10 BlockListType.SPAM_COMPLAINTS_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { BlockListType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.recipient.delBlockListRecipients( 9 ["recipient_id", "recipient_id"], 10 BlockListType.UNSUBSCRIBES_LIST 11) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.template.list({ 9 domain_id: "domain_id" 10}) 11 .then((response) => console.log(response.body)) 12 .catch((error) => console.log(error.body)); 13
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.template.single("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.template.single("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.webhook.list("domain_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.webhook.single("webhook_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { EmailWebhook, EmailWebhookEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const emailWebhook = new EmailWebhook() 9 .setName("Webhook Name") 10 .setUrl("https://example.com") 11 .setDomainId("domain_id") 12 .setEnabled(true) 13 .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]); 14 15mailerSend.email.webhook.create(emailWebhook) 16 .then((response) => console.log(response.body)) 17 .catch((error) => console.log(error.body)); 18
1import 'dotenv/config'; 2import { EmailWebhook, EmailWebhookEventType, MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const emailWebhook = new EmailWebhook() 9 .setName("Webhook Name 2") 10 .setEnabled(false) 11 .setEvents([EmailWebhookEventType.SENT, EmailWebhookEventType.OPENED]); 12 13mailerSend.email.webhook.update("webhook_id", emailWebhook) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.email.webhook.delete("webhook_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1"use strict"; 2require('dotenv').config() 3 4const MailerSend = require("../../src/MailerSend"); 5const SmsParams = require("../../src/SmsParams"); 6 7const mailersend = new MailerSend({ 8 api_key: process.env.API_KEY, 9}); 10 11const recipients = [ 12 "+18332647501" 13]; 14 15const smsParams = new SmsParams() 16 .setFrom("+18332647501") 17 .setRecipients(recipients) 18 .setText("This is the text content"); 19 20mailersend.sendSms(smsParams); 21
1"use strict"; 2require('dotenv').config() 3 4const MailerSend = require("../../src/MailerSend"); 5const SmsParams = require("../../src/SmsParams"); 6 7const mailersend = new MailerSend({ 8 api_key: process.env.API_KEY, 9}); 10 11const recipients = [ 12 "+18332647501", 13 "+18332647502" 14]; 15 16const personalization = [ 17 { 18 "phone_number": "+18332647501", 19 "data": { 20 "name": "Dummy" 21 } 22 }, 23 { 24 "phone_number": "+18332647502", 25 "data": { 26 "name": "Not Dummy" 27 } 28 } 29]; 30 31const smsParams = new SmsParams() 32 .setFrom("+18332647501") 33 .setRecipients(recipients) 34 .setPersonalization(personalization) 35 .setText("Hey {{name}} welcome to our organization"); 36 37mailersend.sendSms(smsParams); 38
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.number.list({ 9 paused: false, 10 limit: 10, 11 page: 1 12}) 13 .then((response) => console.log(response.body)) 14 .catch((error) => console.log(error.body)); 15
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.number.single("sms_number_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.number.update("sms_number_id", true) 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.number.delete("sms_number_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.message.list({ 9 limit: 10, 10 page: 1 11}) 12 .then((response) => console.log(response.body)) 13 .catch((error) => console.log(error.body)); 14
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.message.single("sms_message_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, SmsActivityStatusType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.activity.list({ 9 sms_number_id: "number_id", 10 status: [SmsActivityStatusType.SENT, SmsActivityStatusType.DELIVERED], 11 limit: 10, 12 page: 1 13}) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.activity.single("sms_message_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.recipient.list({ 9 sms_number_id: "sms_number_id", 10 status: "active", 11 limit: 10, 12 page: 1, 13}) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.recipient.single("sms_recipient_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.recipient.update("sms_recipient_id", "active") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.webhook.list("sms_number_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.webhook.single("sms_webhook_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, SmsWebhook, SmsWebhookEventType } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const smsWebhook = new SmsWebhook() 9 .setName("Sms Webhook") 10 .setUrl("https:://yourapp.com/hook") 11 .setSmsNumberId("sms_number_id") 12 .setEnabled(true) 13 .setEvents([SmsWebhookEventType.SENT, SmsWebhookEventType.DELIVERED]) 14 15mailerSend.sms.webhook.create(smsWebhook) 16 .then((response) => console.log(response.body)) 17 .catch((error) => console.log(error.body)); 18
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.webhook.update("sms_webhook_id", { 9 name: "Webhook", 10 url: "https:://yourapp.com/hook", 11 enabled: ["sms.sent", "sms.delivered", "sms.failed"], 12 enabled: true 13}) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.webhook.delete("sms_webhook_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.inbound.list({ 9 enabled: 1, 10 sms_number_id: "sms_number_id", 11 limit: 10, 12 page: 1, 13}) 14 .then((response) => console.log(response.body)) 15 .catch((error) => console.log(error.body)); 16
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.inbound.single("sms_inbound_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend, SmsInbound } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const smsInbound = new SmsInbound() 9 .setSmsNumberId("sms_number_id") 10 .setEnabled(true) 11 .setName("Inbound Name") 12 .setForwardUrl("yourapp.com/hook") 13 .setFilter({ 14 comparer: "equal", 15 value: "START" 16 }); 17 18mailerSend.sms.inbound.create(smsInbound) 19 .then((response) => console.log(response.body)) 20 .catch((error) => console.log(error.body)); 21
1import 'dotenv/config'; 2import { MailerSend, SmsInbound } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8const smsInbound = new SmsInbound() 9 .setSmsNumberId("sms_number_id") 10 .setEnabled(true) 11 .setName("Inbound Name Update") 12 .setForwardUrl("yourapp.com/hook") 13 .setFilter({ 14 comparer: "equal", 15 value: "START" 16 }); 17 18mailerSend.sms.inbound.update("sms_inbound_id", {...smsInbound}) 19 .then((response) => console.log(response.body)) 20 .catch((error) => console.log(error.body)); 21
1import 'dotenv/config'; 2import { MailerSend } from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.sms.inbound.delete("sms_inbound_id") 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
1import 'dotenv/config'; 2import { MailerSend} from "mailersend"; 3 4const mailerSend = new MailerSend({ 5 apiKey: process.env.API_KEY, 6}); 7 8mailerSend.others.getApiQuota() 9 .then((response) => console.log(response.body)) 10 .catch((error) => console.log(error.body)); 11
In case you find any bugs, submit an issue directly here in GitHub.
You are welcome to create SDK for any other programming language.
If you have any troubles using our API or SDK free to contact our support by email info@mailersend.com
The official documentation is at https://developers.mailersend.com
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 8/21 approved changesets -- score normalized to 3
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More