Skip to content

Releases: nylas/nylas-ruby

v5.12.1

12 Aug 20:30

Choose a tag to compare

This new release of the Nylas Ruby SDK brings a couple of new additions and a fix.

Release Notes

Changed

  • Add support for getting ids and count for collections not supported by the API (#380, #381 fixes #378)

Fixed

  • Fix Ruby 3.x compatibility for expanding keyword arguments (#379)

New Contributors 🎉

v5.12.0

29 Jul 19:54

Choose a tag to compare

This new release of the Nylas Ruby SDK brings a couple of new additions and a fix.

Release Notes

Added

  • Add missing hosted authentication parameters (#374)
  • Add reply_to_message_id field in Messages (#376)

Fixed

  • Fix calendar availability failing when round_robin is nil, fixes #373 (#375)

New Contributors 🎉

v5.11.0

08 Jul 21:01

Choose a tag to compare

This new release of the Nylas Ruby SDK brings support for new fields in Event and Job Status.

Release Notes

Added

  • Add support for event reminders (#370, #369)
  • Add metadata field to JobStatus (#371)

Usage

Event Reminders

example_calendar = api.calendars.last
api.events.create(
  title: "A fun event!",
  location: "The Party Zone",
  calendar_id: example_calendar.id,
  when: { start_time: Time.now + 60, end_time: Time.now + 120 },
  reminder_minutes: 20,
  reminder_method: "email"
)

v5.10.0

10 May 22:00

Choose a tag to compare

This new release of the Nylas Ruby SDK brings support for collective and group events, as well as a fix.

Release Notes

Added

  • Support collective and group events

Fixed

  • Fix ModelNotFilterableError when querying for accounts with metadata

v5.9.2

04 May 21:51

Choose a tag to compare

This release of the Nylas Ruby SDK comes with a couple of minor fixes.

Release Notes

Fixed

  • Fix calendar availability not serializing FreeBusy and OpenHours properly (#363)
  • Fix Authentication demo app using deprecated Google scopes

v5.9.1

20 Apr 22:17

Choose a tag to compare

This release of the Nylas Ruby SDK comes with a couple of minor changes.

Release Notes

Added

  • Add missing phone_number field in Participant

Fixed

  • Fix NoMethodError when calling NewMessage#send! (#358)

v5.9.0

07 Apr 18:46

Choose a tag to compare

This release of the Nylas Ruby SDK comes with a few new features and changes!

Release Notes

Added

  • Add Outbox support
  • Add new authentication_type field in Account
  • Add support for basic authentication

Changed

  • Enable Nylas API v2.5 support

Using New Features

Outbox

To send a new message to the outbox:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

# Create a new draft
draft = Nylas::Draft.new(to: [{ email: "email@example.com", name: "Me" }],
                          subject: "A new draft!",
                          metadata: {sdk: "Ruby SDK"})

# Set additional optional parameters
tomorrow = (Date.today + 1).to_time.to_i
day_after = (Date.today + 2).to_time.to_i

# Send the outbox message
outbox_job_status = nylas.outbox.send(draft, send_at: tomorrow, retry_limit_datetime: day_after)

To update an outbox message after sending it

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

# Fetch the job status
outbox_job_status = nylas.job_statuses.find("JOB_STATUS_ID")
outbox_message = outbox_job_status.original_data

# Make changes
outbox_message.subject = "Updated subject"
tomorrow = (Date.today + 1).to_time.to_i
day_after = (Date.today + 2).to_time.to_i

# Update the outbox job
updated_job_status = nylas.outbox.send('JOB_STATUS_ID', message: outbox_message, send_at: tomorrow, retry_limit_datetime: day_after);

To delete an outbox job

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

nylas.outbox.delete("JOB_STATUS_ID")

We also support SendGrid operations. To get the authentication and verification status

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

send_grid_verification = nylas.outbox.send_grid_verification_status
verification.domain_verified
verification.sender_verified

To delete a SendGrid user:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

nylas.outbox.delete_send_grid_sub_user("email@address.com");

v5.8.0

18 Mar 17:30

Choose a tag to compare

This release of the Nylas Ruby SDK comes with a few new features and fixes!

Release Notes

Added

  • Improved support for Webhook objects
  • Support calendars for availability methods (#350)

Fixed

  • Fix interval_minutes keyword for availability methods (#351)

Using New Features

Webhooks

We have provided some modules that can help with setting the correct values for webhooks:

# For state,
WebhookState::ACTIVE # = "active"
WebhookState::INACTIVE # = "inactive"

# For triggers
WebhookTrigger::ACCOUNT_CONNECTED # = "account.connected"
WebhookTrigger::MESSAGE_CREATED # = "message.created"
WebhookTrigger::THREAD_REPLIED # = "thread.replied"
WebhookTrigger::CALENDAR_UPDATED # = "calendar.updated"
# ... and many, many more!

To create a webhook:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

webhook = nylas.webhooks.create(
  callback_url: "WEBHOOK_URL",
  state: WebhookState::ACTIVE,
  triggers: [WebhookTrigger::EVENT_CREATED],
)

To update a webhook:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

webhook = api.webhooks.first

webhook.update(state: WebhookState::INACTIVE)

To delete a webhook:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

webhook = api.webhooks.first

webhook.destroy

New Contributors

  • @thestrabusiness made their first contributions with Support calendars keyword for availability requests (#350) and Update interval keyword arg for calendar availability methods (#351)

v5.7.0

21 Jan 16:25

Choose a tag to compare

This new release of the Nylas Ruby SDK introduces some new features as well as enhancements.

New Features

  • Add job status support
  • Add Event to ICS support
  • Add support for getting access token information

Enhancements

  • Improved support for Application Details
  • Enable ability to delete Account objects
  • Fix saving and deleting Folder objects

Using New Features

Job Status

To view all Job statuses

nylas.job_statuses

To view a specific Job status

nylas.job_statuses.find("JOB_STATUS_ID")

To get a boolean value representing Job status success/failure

job_status = nylas.job_statuses.find("JOB_STATUS_ID")
job_status.successful?

Generating an ICS from an Event

nylas = Nylas::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'],
                     access_token: ENV['NYLAS_ACCESS_TOKEN'])
example_event = api.events.last

# Generate an ICS from an event
ics = example_event.generate_ics

# You can also pass ICS Options for more configuration
ics = example_event.generate_ics(
  ical_uid: "test_uuid",
  method: "add",
  prodid: "test_prodid"
)

Getting information about an access token

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

account = nylas.accounts.first
token_info = account.token_info("ACCESS_TOKEN")

Improved Application Detail support

To get application details:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET
)

app_data = nylas.application_details

To update application details:

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET
)

app_data = nylas.application_details
app_data.application_name = "New Name"

updated_app_data = nylas.updated_application_details(app_data)

Deleting an account

nylas = Nylas::API.new(
    app_id: APP_ID,
    app_secret: APP_SECRET,
    access_token: ACCESS_TOKEN
)

account = nylas.accounts.find('{id}')

# Delete the account
account.destroy

v5.6.1

13 Dec 22:56

Choose a tag to compare

This new release of the Nylas Ruby SDK introduces a couple of enhancements.

Enhancements

  • Enabled support for adding metadata to a NewMessage/Draft
  • Fix bug where updating an Event results in an API error

Using Newly Enabled Metadata Support

Metadata can now be added to a Draft:

draft = api.drafts.create(to: [{ email: "not-a-real-email@example.com"}],
                          subject: "A new draft!",
                          metadata: {test: "yes"})
draft.send!

Metadata can also be directly added to a NewMessage and sent:

message = api.send!(to: [{ email: "not-a-real-email@example.com"}],
                          subject: "A new message!",
                          metadata: {test: "yes"})