{"id":8068,"date":"2017-07-04T12:05:23","date_gmt":"2017-07-04T03:05:23","guid":{"rendered":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=8068"},"modified":"2023-01-13T16:39:38","modified_gmt":"2023-01-13T07:39:38","slug":"elixir%e3%81%8b%e3%82%89sendgrid%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%a6%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=8068","title":{"rendered":"Elixir\u304b\u3089SendGrid\u3092\u5229\u7528\u3057\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p class=\"fill\" style=\"background-color: #ffffff; padding: 0px 0;\"><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/07\/logo-elixir.png\" alt=\"logo-elixir\" width=\"50%\" class=\"alignnone size-full wp-image-8099\" srcset=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/07\/logo-elixir.png 300w, https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/07\/logo-elixir-225x150.png 225w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3>\u306f\u3058\u3081\u306b<\/h3>\n<p>\u4eca\u56de\u306f<a href=\"https:\/\/elixir-lang.org\/\" target=\"_blank\">Elixir<\/a>\u304b\u3089SendGrid\u3092\u5229\u7528\u3057\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u3044\u304f\u3064\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002SendGrid\u3067\u306f7\u3064\u306e\u8a00\u8a9e\u5411\u3051\u306b<a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/Integrate\/libraries.html\" target=\"_blank\">\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u3053\u306e\u4e2d\u306bElixir\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>Elixir\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30eb\u300c<a href=\"https:\/\/hex.pm\/\" target=\"_blank\">hex<\/a>\u300d\u3067\u691c\u7d22\u3059\u308b\u3068\u3001<a href=\"https:\/\/hex.pm\/packages\/bamboo\" target=\"_blank\">bamboo<\/a>\u3001<a href=\"https:\/\/hex.pm\/packages\/swoosh\" target=\"_blank\">swoosh<\/a>\u3001<a href=\"https:\/\/hex.pm\/packages\/sendgrid\" target=\"_blank\">sendgrid<\/a>\u3068\u3044\u3063\u305f3rd\u30d1\u30fc\u30c6\u30a3\u88fd\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u3059\u3002bamboo\u3068swoosh\u306f\u3044\u305a\u308c\u3082SMTP\u3092\u5229\u7528\u3057\u305f\u30e1\u30fc\u30eb\u9001\u4fe1\u306b\u7279\u5316\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002\u4e00\u65b9\u3001sendgrid\u306fWeb API\u30d9\u30fc\u30b9\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u542b\u3081\u305d\u306e\u4ed6\u306e\u69d8\u3005\u306aSendGrid\u306e\u6a5f\u80fd\u3092API\u7d4c\u7531\u3067\u5229\u7528\u3067\u304d\u308b\u306e\u304c\u7279\u5fb4\u3067\u3059\u3002\u4eca\u56de\u306f\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5b9f\u7e3e\u306e\u5927\u304d\u3044bamboo\u3068Web API\u30d9\u30fc\u30b9\u306esendgrid\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<p>\u5404\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3084\u5b9f\u884c\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u5404\u30ea\u30dd\u30b8\u30c8\u30ea\u306eREADME\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/SendGridJP\/sendgridjp-bamboo-example\" target=\"_blank\">sendgridjp-bamboo-example<\/a><br \/>\n<a href=\"https:\/\/hex.pm\/packages\/bamboo\" target=\"_blank\">bamboo<\/a>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5229\u7528\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002bamboo 0.8.0\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li><a href=\"https:\/\/github.com\/SendGridJP\/sendgridjp-elixir-example\" target=\"_blank\">sendgridjp-elixir-example<\/a><br \/>\n<a href=\"https:\/\/hex.pm\/packages\/sendgrid\" target=\"_blank\">sendgrid<\/a>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5229\u7528\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002sendgrid 1.4.0\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3044\u305a\u308c\u3082\u4ee5\u4e0b\u306e\u74b0\u5883\u3067\u52d5\u4f5c\u78ba\u8a8d\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Erlang\/OTP 19.3<\/li>\n<li>Elixir 1.4.4<\/li>\n<\/ul>\n<h3>bamboo\u30d1\u30c3\u30b1\u30fc\u30b8<\/h3>\n<p>bamboo\u306b\u542b\u307e\u308c\u308bSendgridAdapter\u3092\u5229\u7528\u3057\u305f\u30b7\u30f3\u30d7\u30eb\u306a\u30e1\u30fc\u30eb\u9001\u4fe1\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002SendgridAdapter\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u6307\u5b9a\u3068\u7f6e\u63db\u8a2d\u5b9a\u3092\u884c\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\ndef single_email_to_a_single_recipient do\r\n    from = %SendgridjpBambooExample.User{name: &quot;\u9001\u4fe1\u8005\u540d&quot;, email: &quot;from@example.com&quot;}\r\n    new_email()\r\n    |&gt; to(&quot;to@example.com&quot;)\r\n    |&gt; from(from)\r\n    |&gt; subject(&quot;&#x5B;sendgridjp-bamboo-example] \u30d5\u30af\u30ed\u30a6\u306e\u304a\u540d\u524d\u306ffullname\u3055\u3093&quot;)\r\n    |&gt; text_body(&quot;familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\\r\\n \u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n    |&gt; html_body(&quot;&lt;strong&gt; familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f&lt;\/strong&gt;&lt;br \/&gt;\u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n    |&gt; substitute(&quot;fullname&quot;, &quot;\u7530\u4e2d \u592a\u90ce&quot;)\r\n    |&gt; substitute(&quot;familyname&quot;, &quot;\u7530\u4e2d&quot;)\r\n    |&gt; substitute(&quot;place&quot;, &quot;\u4e2d\u91ce&quot;)\r\n  end\r\n<\/pre>\n<p>\u57fa\u672c\u7684\u306bbamboo\u306f1\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30671\u901a\u306e\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u4f7f\u3044\u65b9\u304c\u60f3\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u7d20\u306eSMTP\u3092\u5229\u7528\u3057\u3066\u5927\u91cf\u306e\u30e1\u30fc\u30eb\u914d\u4fe1\u3092\u884c\u3046\u306b\u306f\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7e70\u308a\u8fd4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3053\u3067\u3001SendGrid\u72ec\u81ea\u306e<a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/API_Reference\/SMTP_API\/index.html\" target=\"_blank\">X-SMTPAPI\u30d8\u30c3\u30c0<\/a>\u3092\u5229\u7528\u3057\u30661\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u5927\u91cf\u306e\u30e1\u30fc\u30eb\u3092\u914d\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002X-SMTPAPI\u30d8\u30c3\u30c0\u3092\u5229\u7528\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\ndef single_email_to_multiple_recipients do\r\n  from = %SendgridjpBambooExample.User{name: &quot;\u9001\u4fe1\u8005\u540d&quot;, email: &quot;from@example.com&quot;}\r\n  smtpapi = %{\r\n    &quot;to&quot; =&gt; &#x5B;&quot;to1@example.com&quot;, &quot;to2@example.com&quot;, &quot;to3@example.com&quot;],\r\n    &quot;sub&quot; =&gt; %{\r\n      &quot;fullname&quot; =&gt; &#x5B;&quot;\u7530\u4e2d \u592a\u90ce&quot;, &quot;\u4f50\u85e4 \u6b21\u90ce&quot;, &quot;\u9234\u6728 \u4e09\u90ce&quot;],\r\n      &quot;familyname&quot; =&gt; &#x5B;&quot;\u7530\u4e2d&quot;, &quot;\u4f50\u85e4&quot;, &quot;\u9234\u6728&quot;],\r\n      &quot;place&quot; =&gt; &#x5B;&quot;office&quot;, &quot;home&quot;, &quot;office&quot;]\r\n    },\r\n    &quot;section&quot; =&gt; %{\r\n      &quot;office&quot; =&gt; &quot;\u4e2d\u91ce&quot;,\r\n      &quot;home&quot; =&gt; &quot;\u76ee\u9ed2&quot;\r\n    }\r\n  }\r\n  new_email()\r\n  |&gt; to(&quot;dummy@example.com&quot;)  # \u5b9f\u969b\u306e\u5b9b\u5148\u306fx-smtpapi\u3067\u6307\u5b9a\u3002\u3053\u308c\u306f\u30c0\u30df\u30fc\r\n  |&gt; from(from)\r\n  |&gt; subject(&quot;&#x5B;sendgridjp-bamboo-example] \u30d5\u30af\u30ed\u30a6\u306e\u304a\u540d\u524d\u306ffullname\u3055\u3093&quot;)\r\n  |&gt; text_body(&quot;familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\\r\\n \u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n  |&gt; html_body(&quot;&lt;strong&gt; familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f&lt;\/strong&gt;&lt;br \/&gt;\u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n  |&gt; put_private(&quot;x-smtpapi&quot;, smtpapi)\r\nend\r\n<\/pre>\n<p>bamboo\u306f\u30a2\u30c0\u30d7\u30bf\u65b9\u5f0f\u3092\u63a1\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30a2\u30c0\u30d7\u30bf\u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3067SendGrid\u4ee5\u5916\u306e\u69d8\u3005\u306a\u30e1\u30fc\u30eb\u914d\u4fe1\u30b5\u30fc\u30d3\u30b9\u7d4c\u7531\u3067\u9001\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f55\u3089\u304b\u306e\u7406\u7531\u3067SendGrid\u304c\u5229\u7528\u3067\u304d\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u306a\u3069\u3001\u53ef\u7528\u6027\u306e\u78ba\u4fdd\u306b\u5411\u3044\u3066\u3044\u308b\u3068\u8a00\u3048\u307e\u3059\uff08\u305f\u3060\u3057\u3001\u5207\u308a\u66ff\u3048\u3092\u5bb9\u6613\u306b\u3059\u308b\u306b\u306f\u5404\u30a2\u30c0\u30d7\u30bf\u7279\u6709\u306e\u6a5f\u80fd\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\uff09\u3002<\/p>\n<h3>sendgrid\u30d1\u30c3\u30b1\u30fc\u30b8<\/h3>\n<p>\u6b21\u306bsendgrid\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5229\u7528\u3057\u305f\u30e1\u30fc\u30eb\u9001\u4fe1\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\ndef send_to_a_single_recipient do\r\n  alias SendGrid.{Mailer, Email}\r\n  image = File.read!(&quot;.\/gif.gif&quot;)\r\n  encoded = :base64.encode(image)\r\n  attachment =  %{\r\n    :content =&gt; encoded,\r\n    :type =&gt; &quot;image\/gif&quot;,\r\n    :filename =&gt; &quot;gif.gif&quot;,\r\n    :disposition =&gt; &quot;attachment&quot;\r\n  }\r\n  email =\r\n    Email.build()\r\n    |&gt; Email.add_to(&quot;to@example.com&quot;)\r\n    |&gt; Email.put_from(&quot;from@example.com&quot;, &quot;\u9001\u4fe1\u8005\u540d&quot;)\r\n    |&gt; Email.put_subject(&quot;&#x5B;sendgrid-elixir-example] \u30d5\u30af\u30ed\u30a6\u306e\u304a\u540d\u524d\u306ffullname\u3055\u3093&quot;)\r\n    |&gt; Email.put_text(&quot;familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\\r\\n \u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n    |&gt; Email.put_html(&quot;&lt;strong&gt; familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f&lt;\/strong&gt;&lt;br \/&gt;\u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;)\r\n    |&gt; Email.add_substitution(&quot;fullname&quot;, &quot;\u7530\u4e2d \u592a\u90ce&quot;)\r\n    |&gt; Email.add_substitution(&quot;familyname&quot;, &quot;\u7530\u4e2d&quot;)\r\n    |&gt; Email.add_substitution(&quot;place&quot;, &quot;\u4e2d\u91ce&quot;)\r\n    |&gt; Email.add_header(&quot;X-Sent-Using&quot;, &quot;SendGrid-API&quot;)\r\n    |&gt; Email.add_attachment(attachment)\r\n  Mailer.send(email)\r\nend\r\n<\/pre>\n<p>sendgrid\u30d1\u30c3\u30b1\u30fc\u30b8\u3082bamboo\u3068\u540c\u69d8\u30011\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u30671\u901a\u306e\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u4f7f\u3044\u65b9\u304c\u60f3\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30011\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u5927\u91cf\u306e\u30e1\u30fc\u30eb\u914d\u4fe1\u3092\u884c\u3046\u306b\u306f\u3001\u76f4\u63a5Web API\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5e78\u3044\u3001sendgrid\u30d1\u30c3\u30b1\u30fc\u30b8\u306fHTTPoison\u3068\u3044\u3046HTTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u6a5f\u80fd\u3092\u547c\u3073\u51fa\u305b\u308b\u306e\u3067\u3001SendGrid\u306eWeb API\u3092\u76f4\u63a5\u30b3\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<br \/>\n1\u56de\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u8907\u6570\u306e\u5b9b\u5148\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002\u3061\u3087\u3063\u3068\u8907\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001\u3053\u3046\u3059\u308b\u3053\u3068\u3067Web API\u306e\u6a5f\u80fd\u3092\u5168\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\ndef send_to_multiple_recipients do\r\n  image = File.read!(&quot;.\/gif.gif&quot;)\r\n  encoded = :base64.encode(image)\r\n  attachment =  %{\r\n    :content =&gt; encoded,\r\n    :type =&gt; &quot;image\/gif&quot;,\r\n    :filename =&gt; &quot;gif.gif&quot;,\r\n    :disposition =&gt; &quot;attachment&quot;\r\n  }\r\n  base_url = &quot;\/v3\/mail\/send&quot;\r\n  json = %{\r\n    personalizations: &#x5B;\r\n      %{\r\n        to: &#x5B;%{email: &quot;to1@example.com&quot;}],\r\n        substitutions: %{\r\n          &quot;fullname&quot; =&gt; &quot;\u7530\u4e2d \u592a\u90ce&quot;,\r\n          &quot;familyname&quot; =&gt; &quot;\u7530\u4e2d&quot;,\r\n          &quot;place&quot; =&gt; &quot;office&quot;\r\n        }\r\n      },\r\n      %{\r\n        to: &#x5B;%{email: &quot;to2@example.com&quot;}],\r\n        substitutions: %{\r\n          &quot;fullname&quot; =&gt; &quot;\u4f50\u85e4 \u6b21\u90ce&quot;,\r\n          &quot;familyname&quot; =&gt; &quot;\u4f50\u85e4&quot;,\r\n          &quot;place&quot; =&gt; &quot;home&quot;\r\n        }\r\n      },\r\n      %{\r\n        to: &#x5B;%{email: &quot;to3@example.com&quot;}],\r\n        substitutions: %{\r\n          &quot;fullname&quot; =&gt; &quot;\u9234\u6728 \u4e09\u90ce&quot;,\r\n          &quot;familyname&quot; =&gt; &quot;\u9234\u6728&quot;,\r\n          &quot;place&quot; =&gt; &quot;office&quot;\r\n        }\r\n      }\r\n    ],\r\n    subject: &quot;&#x5B;sendgrid-elixir-example] \u30d5\u30af\u30ed\u30a6\u306e\u304a\u540d\u524d\u306ffullname\u3055\u3093&quot;,\r\n    from: %{\r\n      email: &quot;from@example.com&quot;,\r\n      name: &quot;\u9001\u4fe1\u8005\u540d&quot;\r\n    },\r\n    content: &#x5B;\r\n      %{\r\n        type: &quot;text\/plain&quot;,\r\n        value: &quot;familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\\r\\n \u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;\r\n      },\r\n      %{\r\n        type: &quot;text\/html&quot;,\r\n        value: &quot;&lt;strong&gt; familyname \u3055\u3093\u306f\u4f55\u3092\u3057\u3066\u3044\u307e\u3059\u304b\uff1f&lt;\/strong&gt;&lt;br \/&gt;\u5f7c\u306fplace\u306b\u3044\u307e\u3059\u3002&quot;\r\n      }\r\n    ],\r\n    sections: %{\r\n      &quot;office&quot; =&gt; &quot;\u4e2d\u91ce&quot;,\r\n      &quot;home&quot; =&gt; &quot;\u76ee\u9ed2&quot;\r\n    },\r\n    headers: %{&quot;X-Sent-Using&quot; =&gt; &quot;SendGrid-API&quot;},\r\n    attachments: &#x5B;attachment]\r\n  } |&gt; Poison.encode!\r\n  SendGrid.post!(base_url, json)\r\nend\r\n<\/pre>\n<p>\u307e\u305f\u3001\u30d0\u30a6\u30f3\u30b9\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: ruby; title: ; notranslate\" title=\"\">\r\ndef get_bounces do\r\n  base_url = &quot;\/v3\/suppression\/bounces&quot;\r\n  SendGrid.get!(base_url)\r\nend\r\n<\/pre>\n<h3>\u3055\u3044\u3054\u306b<\/h3>\n<p>\u305d\u308c\u305e\u308c\u7279\u5fb4\u304c\u3042\u308b\u306e\u3067\u3069\u3061\u3089\u304c\u512a\u308c\u3066\u3044\u308b\u3068\u8a00\u3063\u305f\u6bd4\u8f03\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u3046\u307e\u304f\u7d44\u307f\u5408\u308f\u305b\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001SendGrid\u306e\u6a5f\u80fd\u3092\u30d5\u30eb\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002SendGrid\u306e\u30d5\u30ea\u30fc\u30c8\u30e9\u30a4\u30a2\u30eb\uff08\u7121\u671f\u9650\uff09\u3078\u306e\u304a\u7533\u8fbc\u307f\u306f<a href=\"https:\/\/sendgrid.kke.co.jp\/app?p=signup.index\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u304b\u3089\u3069\u3046\u305e\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u4eca\u56de\u306fElixir\u304b\u3089SendGrid\u3092\u5229\u7528\u3057\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u3044\u304f\u3064\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002SendGrid\u3067\u306f7\u3064\u306e\u8a00\u8a9e\u5411\u3051\u306b\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u3053\u306e\u4e2d\u306bElixir\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002 <a class=\"read-more\" href=\"https:\/\/sendgrid.kke.co.jp\/blog\/?p=8068\">&#8230;\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":4,"featured_media":8070,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-8068","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8068"}],"version-history":[{"count":13,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8068\/revisions"}],"predecessor-version":[{"id":16215,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8068\/revisions\/16215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/media\/8070"}],"wp:attachment":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}