Skip to content

blastengineMania/blastengine-gas

Repository files navigation

blastengine SDK for Google Apps Script

Install

ID: 1GvJKygDvrhoq9w1FIRepBo1kAB3yo1LucHtL6CIM-KqmaFaxLUbyBdim

Usage

Initialize

Blastengine.init('YOUR_USER_NAME', 'YOUR_API_KEY');

Transaction

const transaction = Blastengine.transaction();

Text email

transaction.fromEmail = 'info@example.com';
transaction.setTo('user@example.jp');
transaction.subject = 'Test subject';
transaction.setText('Test body');
const res = transaction.send();
console.log(res);
// { delivery_id: 188 }

Attachments

const file = DriveApp.getFileById('DRIVE_FILE_ID');
const response = UrlFetchApp.fetch('https://example.com/logo.jpg');

File attached.

transaction.addAttachment(file.getBlob());
transaction.addAttachment(response.getBlob());
const res = transaction.send();
console.log(res);
// { delivery_id: 189 }

Bluk email

const bulk = Blastengine.bulk();

Save email

bulk.fromEmail = 'info@example.com';
bulk.subject = 'Test subject';
bulk.setText('Text body with  __name__');
const res =  bulk.register();
console.log(res);
// { delivery_id: 189 }

Add to

bulk.setTo('user1@example.jp', {
	'name': 'User 1',
});
bulk.setTo('user2@example.jp', {
	'name': 'User 2',
});
bulk.update();

Send email

bulk.send();

Delete bulk email

bulk.delete();

License

MIT

About

Google Apps Script向けのblastengine SDKです

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors