mailgun / mailgun.js

Javascript SDK for Mailgun
https://www.npmjs.com/package/mailgun.js
Apache License 2.0
519 stars 109 forks source link

Does this sdk have methods for creating and updating templates? #418

Open magick93 opened 1 month ago

magick93 commented 1 month ago

Hello

I see the mailgun api has methods related to creating and updating of templates.

Does this sdk provide related functionality?

Thanks

olexandr-mazepa commented 1 month ago

Yes it does. Mentioned API is accessible under domain.domainTemplates

const mailgun = new Mailgun(FormData);
const mg = mailgun.domains.domainTemplates.create(
  domain: string,
  data: DomainTemplateData
)

By unknown reason examples are missed in readme file, so you can use class below to see available methods and their signatures: https://github.com/mailgun/mailgun.js/blob/master/lib/Classes/Domains/domainsTemplates.ts#L158