Ruby
Last updated
Was this helpful?
Last updated
Was this helpful?
Enveloop provides the wrapper for our Enveloop API. It simplifies configuring and sending messages (email & SMS/text) via Enveloop inside your Ruby apps.
There are a couple of ways to get started. Using , you can install it locally with the following command:
Additionally, you can add the following to your application's Gemfile:
After doing so, you can run the following terminal command:
The Enveloop Gem includes helpful methods to interact with the Enveloop API, including:
send_message
template_info
We'll talk about how to use some of these methods in the notes to follow.
First, let's set up a connection. You'll need to require the enveloop
gem, define a client, and add in your Enveloop API token. Your API token is located in the Settings for each project you have on .
Now that your connection is established, let's use a method to send a message.
(Note: This method call assumes that you have created a basic template in Enveloop and provides an example of a template variable you may use. Please alter according to how you have set up your template.)
If you want to send a message, via Enveloop, and not use an Enveloop template, you can remove the template
argument from the method and include the html
argument instead (it takes a custom HTML body and creates a structured email message to send out).
Along with email messages, you can also send text/SMS messages via Enveloop. In this example, the registration-complete
template is an SMS template. Therefore, Enveloop can accept mobile numbers for to/from.
Bug reports and pull requests are welcome on GitHub at . Additional information, including license, development procedures, and Code of Conduct are available in the source repository documentation.