Skip to content

Instantly share code, notes, and snippets.

View mb8z's full-sized avatar
🎯
Focusing

mb8z mb8z

🎯
Focusing
  • Freelance
  • Warsaw, Poland
View GitHub Profile

Instrukcja

Uruchamianie edycji pliku

  1. Wybrać edytor tekstowy – jednym z lepszych do tego typu zadań jest Visual Studio Code udostępniany za darmo przez Microsoft – https://code.visualstudio.com/
  2. Po instalacji otworzyć program i przeciągnąć do niego pliki.

Zasady tłumaczenia plików .js

  1. Plik zaczyna się od sformułowania module.exports = – tę część dostawiamy niezmienioną
const dayjs = require('dayjs');
const { SMS } = require('automagically');
const templates = {
appointmentReminder: 'You have a doctor\'s appointment coming on {{date}}. Assigned doctor: {{doctorFullName}}',
};
const dateFormat = 'YYYY-MM-DD HH:mm';
const send = async () => {
const { SMS } = require('automagically');
const send = async () => {
// SMS with the same body
const sameBodySMS = await SMS.send({
from: { phone: '+44500500500' },
to: [
{ phone: 'PHONE_NUMBER_1' },
{ phone: 'PHONE_NUMBER_2' },
],
const { SMS } = require('automagically');
const send = async () => {
const sms = await SMS.send({
from: { phone: '+44500500500' },
to: [{ phone: 'PHONE_NUMBER_1' }],
body: 'Hello, world!',
});
};
# Some python code here
@mb8z
mb8z / am-emails-template-multiple-recipients.js
Created March 3, 2021 17:25
Sending an email to multiple recipients
const { Emails } = require('automagically');
const send = async () => {
const email = Emails.send({
from: { email: '[email protected]', name: 'AwesomeApp' },
to: [
{ email: '[email protected]', name: 'John Doe', age: 30 },
{ email: '[email protected]', name: 'Foo Bar', age: 20 },
],
template: 'my-sendgrid-template-id-here',
@mb8z
mb8z / am-emails-text-multiple-recipients-variables.js
Created March 3, 2021 17:24
Sending an email to multiple recipients with variables
const { Emails } = require('automagically');
const send = async () => {
const email = Emails.send({
from: { email: '[email protected]', name: 'AwesomeApp' },
to: [
{ email: '[email protected]', name: 'John Doe', age: 20 },
{ email: '[email protected]', name: 'Foo Bar', age: 30 },
],
subject: 'Welcome {{name}} – it\'s your birthday!',
@mb8z
mb8z / am-emails-text-multiple-recipients.js
Last active March 3, 2021 17:24
Sending an email to multiple recipients
const { Emails } = require('automagically');
const send = async () => {
const email = Emails.send({
from: { email: '[email protected]', name: 'AwesomeApp' },
to: [
{ email: '[email protected]', name: 'John Doe' },
{ email: '[email protected]', name: 'Foo Bar' },
],
subject: 'Welcome',
@mb8z
mb8z / am-emails-text-one-recipient-bccs-ccs.js
Last active March 3, 2021 17:24
Sending an email to one recipient with bccs and ccs
const { Emails } = require('automagically');
const send = async () => {
const email = Emails.send({
from: { email: '[email protected]', name: 'AwesomeApp' },
to: [{ email: '[email protected]', name: 'John Doe' }],
bcc: [{ email: '[email protected]', name: 'Kylo Ren' }],
cc: [{ email: '[email protected]', name: 'Leia' }],
subject: 'Welcome',
text: 'Hey there, this is a test email!',