This repository was archived by the owner on Dec 3, 2019. It is now read-only.
Repository navigation
Conversation
hpjaj
reviewed
Jul 14, 2017
| class SendGridClientError < StandardError; end | ||
|
|
||
| def initialize | ||
| @sendgrid = SendGrid::API.new(api_key: OperationCode.fetch_secret_with(name: :sendgrid_api_key)) |
Contributor
There was a problem hiding this comment.
This line is a bit long. Perhaps abstract this into a private method?
def instantiate_sendgrid
key = OperationCode.fetch_secret_with name: :sendgrid_api_key
SendGrid::API.new api_key: key
endor
def oc_sendgrid_key
OperationCode.fetch_secret_with name: :sendgrid_api_key
end
def sendgrid_object
SendGrid::API.new api_key: oc_sendgrid_key
end| private | ||
|
|
||
| def add_recipient(data) | ||
| response = Response.new(@sendgrid.client.contactdb.recipients.post(request_body: [data])) |
Contributor
There was a problem hiding this comment.
This line is pretty complex. Perhaps abstract this into its own private method?
def generate_sendgrid_response(data)
Response.new(@sendgrid.client.contactdb.recipients.post(request_body: [data]))
endAlso, perhaps add some commented out documentation explaining/referencing the chain from @sendgrid to .post?
| end | ||
|
|
||
| def add_recipient_to_list(recipient_id) | ||
| response = Response.new(@sendgrid.client.contactdb.lists._(LIST_ID).recipients._(recipient_id).post()) |
Contributor
Author
|
@hpjaj Fixes are in. |
hpjaj
approved these changes
Jul 14, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Adds a new job to run when a user signs up to add them to our sendgrid contact list.
Issue Resolved
Fixes #49