![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
sendgrid_template_engine
Advanced tools
This gem allows you to quickly and easily access to SendGrid Template Engine using Ruby. See api reference for more detail
Add this line to your application's Gemfile:
gem 'sendgrid_template_engine'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sendgrid_template_engine
#
# Retrieve all templates
#
templates = SendgridTemplateEngine::Templates.new("user", "pass")
tmps = templates.get_all()
tmps.each {|tmp|
puts tmp.id
puts tmp.name
tmp.versions.each {|ver|
puts ver.id
puts ver.template_id
puts ver.active
puts ver.name
puts ver.updated_at
}
}
#
# Retrieve a single template
#
templates = SendgridTemplateEngine::Templates.new("user", "pass")
tmp = templates.get(template_id)
puts tmp.id
puts tmp.name
tmp.versions.each {|ver|
puts ver.id
puts ver.template_id
puts ver.active
puts ver.name
puts ver.updated_at
}
#
# Create a template
#
templates = SendgridTemplateEngine::Templates.new(@username, @password)
tmp = templates.post("new_template_name")
#
# Edit a template
#
templates = SendgridTemplateEngine::Templates.new(@username, @password)
tmp = templates.patch("edit_template_name")
#
# Delete a template
#
templates = SendgridTemplateEngine::Templates.new(@username, @password)
tmp = templates.delete(template_id)
#
# Retrieve a specific version of template
#
versions = SendgridTemplateEngine::Versions.new(@username, @password)
ver = versions.get(template_id, version_id)
puts ver.id
puts ver.template_id
puts ver.active
puts ver.name
puts ver.html_content
puts ver.plain_content
puts ver.subject
puts ver.update_at
#
# Create a new version
#
new_version = SendgridTemplateEngine::Version.new()
new_version.set_name("new_version")
new_version.set_subject("<%subject%>")
new_version.set_html_content("<%body%>")
new_version.set_plain_content("<%body%>")
new_version.set_active(1)
versions = SendgridTemplateEngine::Versions.new(@username, @password)
ver = versions.post(template_id, new_version)
#
# Activate a version
#
versions = SendgridTemplateEngine::Versions.new(@username, @password)
ver = versions.post_activate(template_id, version_id)
#
# Edit a version
#
edit_version = SendgridTemplateEngine::Version.new()
edit_version.set_name("edit_version")
edit_version.set_subject("edit<%subject%>edit")
edit_version.set_html_content("edit<%body%>edit")
edit_version.set_plain_content("edit<%body%>edit")
edit_version.set_active(0)
versions = SendgridTemplateEngine::Versions.new(@username, @password)
ver = versions.patch(template_id, version_id, edit_version)
#
# Delete a version
#
versions = SendgridTemplateEngine::Versions.new(@username, @password)
versions.delete(template_id, version_id)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sendgrid_template_engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.