Communicate JS APIs

The fliplet-communicate package contains the namespace Fliplet.Communicate and a set of helper methods for sending communications from the app.

Send an email

const options = {
  to: [{
    email: "john@example.org",
    name: "John",
    type: "to"
  }],
  html: "<p>Some HTML content</p>",
  subject: "My subject"
};

Fliplet.Communicate.sendEmail(options);

Send an SMS

Default provider

const options = {
  data: {
    to: "+123456789",
    body: "Hey!"
  }
};

Fliplet.Communicate.sendSMS(options);

Twilio

const options = {
  provider: "twilio"
  data: {
    from: "+123456789"
    to: "+123456789",
    body: "Hey!"
  },
  options: {
    twilio_sid: 'AC81caaa94b3b84bb7ba9c3cd96bcb152a', // Your Account SID from www.twilio.com/console
    twilio_auth_token: 'AUTH_TOKEN';                  // Your Auth Token from www.twilio.com/console
  }
};

Fliplet.Communicate.sendSMS(options);

Let us know if you require to use another SMS provider and we’ll check whether we can integrate it on our system.

Share a URL

(Returns Promise)

Lets users share a URL. The Promise is resolved when the action is completed or dismissed. The URL is passed to the resolving function, or is undefined if the action is cancelled.

Fliplet.Communicate.shareURL('https://maps.google.com/?addr=N1+9PF');

Optionally provide a target to enure the share popover appears in the right place on iPads.

Fliplet.Communicate.shareURL({
  url: 'https://maps.google.com/?addr=N1+9PF',
  target: '#target'
});

Back to API documentation