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
const { SMS } = require('automagically');
const send = async () => {
const sms = await SMS.send({
from: { phone: '+44500500500' },
to: [{ phone: 'PHONE_NUMBER_1' }],
body: 'Hello, world!',
});
};
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 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 () => {

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 useDocty = require('@usedocty/node');
const Docty = useDocty('{{API_KEY}}');
const example = async () => {
const documents = await Docty.Documents.list();
console.log('Documents:', documents);
};
example();
const useDocty = require('@usedocty/node');
const Docty = useDocty('{{API_KEY}}');
const example = async () => {
const documents = await Docty.Documents.get('document-uuid-is-here');
console.log('Document:', document);
};
example();
const useDocty = require('@usedocty/node');
const Docty = useDocty('{{API_KEY}}');
const example = async () => {
const users = await Docty.Users.add(['[email protected]']);
console.log('Users:', users);
};
example();
const useDocty = require('@usedocty/node');
const Docty = useDocty('{{API_KEY}}');
const example = async () => {
await Docty.Users.remove(['[email protected]']);
};
example();
const useDocty = require('@usedocty/node');
const Docty = useDocty('{{API_KEY}}');
const example = async () => {
const consents = await Docty.Consents.add('[email protected]', ['document-uuid-is-here']);
console.log('Consents:', consents);
};
example();