mailersend / mailersend-ruby Goto Github PK
View Code? Open in Web Editor NEWThe official MailerSend Ruby SDK
Home Page: https://developers.mailersend.com
License: MIT License
The official MailerSend Ruby SDK
Home Page: https://developers.mailersend.com
License: MIT License
We added two parameters for our domains: ignore duplicated recipients and add a precedence bulk header. Both of these parameters have to be added to our related Domains endpoints.
Makes the API_TOKEN
configurable through config file, hence the env variable name can be anything
The only way to set the token now is through env variable, which might clash with another environment variable with the same name
Hi MailerSend! ๐ ๐
Would you be open to making the dotenv
an optional dependency so that it doesn't need to be loaded in production environments? It looks like it's only being used in a few places, but removing those without breaking the existing behavior for users of your gem who want to continue using dotenv might be tricky.
There is the add_tags
method in the MailerSend::Email class but it does not seem to add tags to the email.
If you take the readme example code and add:
...
ms_email.add_tags('test-tag')
# Send the email
ms_email.send
It will not add a tag to the email.
Thanks!
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
Gemfile
bundler '~> 2.4.22'
rake '~> 13.0'
rubocop '~> 1.7'
.github/workflows/main.yml
actions/checkout v4
actions/setup-ruby v1
.github/workflows/publish_gem.yml
actions/checkout v4
actions/setup-ruby v1
We recently added the in-reply-to option to the header.
Please include it in the SDK, under the Send an email endpoint. Documentation is here.
We have a new parameter called "inbound_priority" on our Inbound Routes. This parameter allows our users to create multiple inbound routes per inbound subdomain. Each one of the routes will be processed in a descending order. Values can be between 0 and 100. 0 has more importance than 100.
Dotenv
by default will look for a hierarchy of files, but using dotenv/load
drops that to only look for .env
.
Our app uses .env.local
for dev machine environment variables that probably shouldn't be committed, but this doesn't get loaded if we're using mailersend-ruby
. Is there a way to avoid the dotenv/load
call somehow?
...via rspec and vcr.
The local variable response
is not initialized in lib/mailersend/sender_identity/sender_identity.rb
prior to being used in the last line of the list
method:
def list(domain_id: nil, page: nil, limit: nil)
hash = {
'domain_id' => domain_id,
'page' => page,
'limit' => limit
}
client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/identities',
query: URI.encode_www_form(hash.compact)))
puts response
end
This results in Mailersend::SenderIdentity.new.list
throwing a NameError
.
irb(main):014:0> Mailersend::SenderIdentity.new.list
Traceback (most recent call last):
1: from (irb):14
NameError (undefined local variable or method `response' for #<Mailersend::SenderIdentity:0x0000aaaaf9ffe7c8>)
Did you mean? respond_to?
Looks like the last line of the method, puts response
, may have been from dev work and just needs to be removed to resolve this.
mailersend-ruby/lib/mailersend/email/email.rb
Lines 31 to 32 in b791c89
I do think that these lines can be interpreted by Ruby and sent through JSON to our API as an empty object
or array
. And in a case where a template_id
is provided, and it has default settings, these are not required and are introducing an error.
This theory should be tested, however.
This is an example that breaks on the API side:
The documentation at https://developers.mailersend.com/api/v1/email.html#send-an-email does not specify any Limitations or details for the reply_to attribute while sending an email. After testing the ruby sdk multiple times, I think that the reply_to field only takes one value at a time, and on sending multiple values, it keeps on overwriting the previous value. This should be mentioned in the documentation I feel. I am ready to contribute in this way, since I also use the mailersend ruby sdk on a daily basis, but I couldn't find the documentation repository.
We recently changed activity fetch in our app so the pagination wasnโt working anymore for the API, could you update the Activity endpoint to match the most recent update?
I see the SenderIdentity#single_by_email
method available albeit I didn't see it in the docs for this Ruby gem.
I have a use case where I may have the same email with two sender identities for two different signed/verified domains and I need to search by both email
and domain_id
to get the correct identity_id
. Since the dataset is small, I can perform a linear search against the output of SenderIdentity#list
, but this isn't a good long term solution.
Is there another endpoint where I can search by both email
and domain_id
? Or, if not, would it be possible to modify this method's target endpoint to include email and domain_id optionally?
def single_by_email(email:)
hash = {
'email' => email
}
client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/identities/email/#{email}",
query: URI.encode_www_form(hash.compact)))
end
As another option, maybe it would be possible to add a separate method, multiple_by_email
or something to return an array of any with the email and then I can perform a search against the reduced data set.
Please add the following endpoints on the new Sender Identity section, below the Domains.
We should allow overriding base API url
https://github.com/mailersend/mailersend-go/blob/main/mailersend.go#L15
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.