-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from railsware/restructure-samples
Restructure samples, add template sample for testing
- Loading branch information
Showing
8 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MailtrapClient } from "../../src" | ||
|
||
/** | ||
* For this example to work, you need to set up a sending domain, | ||
* and obtain a token that is authorized to send from the domain. | ||
* @see https://help.mailtrap.io/article/69-sending-domain-setup | ||
*/ | ||
|
||
const TOKEN = "<YOUR-TOKEN-HERE>"; | ||
const SENDER_EMAIL = "<[email protected]>"; | ||
const RECIPIENT_EMAIL = "<[email protected]>"; | ||
|
||
const client = new MailtrapClient({ token: TOKEN }); | ||
|
||
client.testing.send({ | ||
from: { name: "Mailtrap Test", email: SENDER_EMAIL }, | ||
to: [{ email: RECIPIENT_EMAIL }], | ||
template_uuid: "813e39db-c74a-4830-b037-0e6ba8b1fe88", | ||
template_variables: { | ||
user_name: "John Doe", | ||
} | ||
}) | ||
.then(console.log) | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters