Releases: nylas/nylas-ruby
v5.12.1
This new release of the Nylas Ruby SDK brings a couple of new additions and a fix.
Release Notes
Changed
- Add support for getting
idsandcountfor collections not supported by the API (#380, #381 fixes #378)
Fixed
- Fix Ruby 3.x compatibility for expanding keyword arguments (#379)
New Contributors 🎉
- @icheishvili made their first contribution in #379
v5.12.0
v5.11.0
This new release of the Nylas Ruby SDK brings support for new fields in Event and Job Status.
Release Notes
Added
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
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
ModelNotFilterableErrorwhen querying for accounts with metadata
v5.9.2
v5.9.1
v5.9.0
This release of the Nylas Ruby SDK comes with a few new features and changes!
Release Notes
Added
- Add Outbox support
- Add new
authentication_typefield 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_verifiedTo 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
This release of the Nylas Ruby SDK comes with a few new features and fixes!
Release Notes
Added
- Improved support for
Webhookobjects - Support
calendarsfor availability methods (#350)
Fixed
- Fix
interval_minuteskeyword 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.destroyNew Contributors
- @thestrabusiness made their first contributions with
Support calendars keyword for availability requests(#350) andUpdate interval keyword arg for calendar availability methods(#351)
v5.7.0
This new release of the Nylas Ruby SDK introduces some new features as well as enhancements.
New Features
- Add job status support
- Add
Eventto ICS support - Add support for getting access token information
Enhancements
- Improved support for Application Details
- Enable ability to delete
Accountobjects - Fix saving and deleting
Folderobjects
Using New Features
Job Status
To view all Job statuses
nylas.job_statusesTo 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_detailsTo 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.destroyv5.6.1
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"})