{"id":7496,"date":"2017-02-17T13:04:08","date_gmt":"2017-02-17T04:04:08","guid":{"rendered":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=7496"},"modified":"2024-10-11T15:31:59","modified_gmt":"2024-10-11T06:31:59","slug":"sendgrid%e3%81%a8apex%e3%81%a8aws-lambda%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=7496","title":{"rendered":"SendGrid\u3068Apex\u3068AWS Lambda\u3067\u30e1\u30fc\u30eb\u9001\u4fe1"},"content":{"rendered":"<div style=\"background-color:#000000;\"><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2014\/05\/go-text.png\" alt=\"SendGrid\u3068Apex\u3068AWS Lambda\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\" height=\"170\" class=\"alignnone size-full wp-image-1242 noshadow\" srcset=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2014\/05\/go-text.png 858w, https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2014\/05\/go-text-300x140.png 300w, https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2014\/05\/go-text-768x358.png 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/div>\n<p style=\"margin: 20px 0px;\">SendGrid\u30c6\u30af\u30cb\u30ab\u30eb\u30b5\u30dd\u30fc\u30c8\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u6d25\u7530\u3067\u3059\u3002\u3053\u3053\u6570\u5e74\u3001FaaS (Function as a Service) \u306e\u8a71\u984c\u3092\u3088\u304f\u8033\u306b\u3057\u307e\u3059\u3002<a href=\"https:\/\/aws.amazon.com\/jp\/lambda\/\" target=\"_blank\">AWS Lambda<\/a>\u3001<a href=\"https:\/\/cloud.google.com\/functions\/\" target=\"_blank\">Google Cloud Functions<\/a>\u3001<a href=\"https:\/\/azure.microsoft.com\/ja-jp\/services\/functions\/\" target=\"_blank\">Microsoft Azure Functions<\/a>\u3001IBM OpenWhisk\u306a\u3069\u3001\u5404\u793e\u304c FaaS \u306e\u74b0\u5883\u3092\u767a\u8868\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u8fd1\u3067\u306f\u3001\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u578b\u306e\u30b3\u30fc\u30c9\u5b9f\u884c\u3092\u3064\u306a\u304e\u5408\u308f\u305b\u3066\u3001\u8907\u96d1\u306a\u6a5f\u80fd\u3092\u5b9f\u73fe\u3059\u308b\u4e8b\u4f8b\u3082\u3001\u6570\u591a\u304f\u76ee\u306b\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5b9f\u306f\u5f53\u793e\u3067\u3082 FaaS \u3092\u6d3b\u7528\u3057\u3066\u3044\u307e\u3059\u3002SendGrid \u306e\u65b0\u898f\u4f1a\u54e1\u767b\u9332\u306b\u304a\u7533\u3057\u8fbc\u307f\u3044\u305f\u3060\u304f\u3068\u3001Whois\u306e\u78ba\u8a8d\u3084\u6cd5\u4eba\u30fb\u500b\u4eba\u306e\u5224\u5225\u3001\u90f5\u4fbf\u756a\u53f7\u30fb\u4f4f\u6240\u306e\u6574\u5408\u6027\u306a\u3069\u3001\u3054\u767b\u9332\u5185\u5bb9\u306e\u78ba\u8a8d\u3092\u884c\u3046\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u308b\u4ed5\u7d44\u307f\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u672c\u65e5\u306f\u3001Go\u306e\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea\u3001<a href=\"https:\/\/github.com\/sendgrid\/sendgrid-go\" target=\"_blank\">sendgrid\/sendgrid-go<\/a>\u3001\u3092\u7528\u3044\u3066\u5b9f\u88c5\u3057\u305f\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3092AWS Lambda\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\uff08\uff0b\u03b1\uff09\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u4ee5\u4e0b\u3067\u306f\u3001<\/p>\n<ul style=\"margin: 20px;\">\n<li>SendGrid \u306e\u30a2\u30ab\u30a6\u30f3\u30c8<\/li>\n<li>Amazon Web Service (AWS) \u306e\u30a2\u30ab\u30a6\u30f3\u30c8<\/li>\n<li>(\u30aa\u30d7\u30b7\u30e7\u30f3\uff09<a href=\"https:\/\/aws.amazon.com\/jp\/cli\/\" target=\"_blank\">AWS\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9<\/a><\/li>\n<\/ul>\n<p style=\"margin: 20px 0px;\">\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u65e5\u5e38\u7684\u306b AWS \u3092\u3054\u5229\u7528\u306e\u65b9\u3067\u3042\u308c\u3070\u3001\u7d0410\u5206\uff080.2\u7c73\u30c9\u30eb\u7a0b\u5ea6\uff09\u3067\u304a\u8a66\u3057\u3044\u305f\u3060\u3051\u308b\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<h3>\u6e96\u5099<\/h3>\n<p style=\"margin: 20px 0px;\">\u73fe\u5728\u306e\u3068\u3053\u308d\u3001AWS Lambda\u306e<a href=\"https:\/\/aws.amazon.com\/jp\/lambda\/faqs\/\" target=\"_blank\">\u5bfe\u5fdc\u8a00\u8a9e<\/a>\u306f\u3001Node.js (JavaScript)\u3001Python\u3001Java (Java 8 \u4e92\u63db)\u3001C# \u3067\u3001Go\u306e\u30b3\u30fc\u30c9\u306e\u307e\u307e\u3067\u306f\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u307e\u305b\u3093\u3002\u305f\u3060\u3001Go\u3092\u30d3\u30eb\u30c9\u3059\u308c\u3070\u5404\u7a2e\u74b0\u5883\u4e0b\u3067\u52d5\u4f5c\u3059\u308b\u30b7\u30f3\u30b0\u30eb\u30d0\u30a4\u30ca\u30ea\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u30c7\u30d7\u30ed\u30a4\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3053\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u683c\u7d0d\u3057\u3066Node.js \u306e\u30b3\u30fc\u30c9\u304b\u3089\u5b9f\u884c\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u65b9\u6cd5\u3067\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u4eca\u56de\u306f\u3001\u3055\u3089\u306b\u7c21\u5358\u306bAWS Lambda \u3078\u306e\u30c7\u30d7\u30ed\u30a4\u306e\u64cd\u4f5c\u3092\u5b9f\u884c\u3067\u304d\u308b<a href=\"https:\/\/github.com\/apex\/apex\" target=\"_blank\">Apex<\/a>\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4f8b\u3068\u3057\u3066<a href=\"https:\/\/aws.amazon.com\/jp\/s3\/\" target=\"_blank\">Amazon S3<\/a>\u4e0a\u306b\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u3068\u3044\u3046\u30b7\u30ca\u30ea\u30aa\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u3063\u305f\u74b0\u5883\u306f\u3001<\/p>\n<ul style=\"margin: 20px;\">\n<li>Mac OS X 10.11.6<\/li>\n<li>Go v1.7.5<\/li>\n<li>\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea(<a href=\"https:\/\/github.com\/sendgrid\/sendgrid-go\" target=\"_blank\">sendgrid\/sendgrid-go<\/a>) 3.1.0<\/li>\n<\/ul>\n<p style=\"margin: 20px 0px;\">\u3067\u3059\u3002<\/p>\n<h4>AWS \u306e\u8a8d\u8a3c\u60c5\u5831<\/h4>\n<p style=\"margin: 20px 0px;\">\u307e\u305a\u3001AWS \u306e\u30a2\u30af\u30bb\u30b9\u8a8d\u8a3c\u60c5\u5831\u3092\u74b0\u5883\u5909\u6570\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002 <a href=\"https:\/\/aws.amazon.com\/jp\/cli\/\" target=\"_blank\">AWS \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9<\/a>\u3092\u3054\u5229\u7528\u306e\u5834\u5408\u306f\u3001\u8a2d\u5b9a\u6e08\u306e\u30a2\u30af\u30bb\u30b9\u8a8d\u8a3c\u60c5\u5831\u3092\u5229\u7528\u3067\u304d\u308b\u306e\u3067\u3001\u65b0\u305f\u306b\u74b0\u5883\u5909\u6570\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<ul style=\"margin: 20px;\">\n<li>AWS_ACCESS_KEY_ID (AWS \u30a2\u30af\u30bb\u30b9\u30ad\u30fcID)<\/li>\n<li>AWS_SECRET_ACCESS_KEY (AWS \u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc)<\/li>\n<li>AWS_REGION (AWS \u30ea\u30fc\u30b8\u30e7\u30f3)<\/li>\n<\/ul>\n<h4>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h4>\n<p style=\"margin: 20px 0px;\"><a href=\"http:\/\/apex.run\/\" target=\"_blank\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u306b\u5f93\u3044\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066Apex \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002Apex\u306e<a href=\"https:\/\/github.com\/apex\/apex\/releases\" target=\"_blank\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30b5\u30a4\u30c8<\/a>\u304b\u3089\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u305f\u3060\u3044\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ncurl https:\/\/raw.githubusercontent.com\/apex\/apex\/master\/install.sh | sh\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u305d\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u65b0\u898f\u4f5c\u6210\u3057\u3066\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u521d\u671f\u5316\u3092\u884c\u3044\u307e\u3059\u3002 \u3053\u3053\u3067\u306f \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092sendgrid-lambda-sample\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ mkdir sendgrid-lambda-sample\r\n$ cd sendgrid-lambda-sample\r\n$ apex init\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u521d\u671f\u5316\u306e\u9014\u4e2d\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u540d\u524d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u964d\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u304cSendGridLambdaSample\u306e\u5834\u5408\u3092\u4eee\u5b9a\u3057\u3066\u9032\u307f\u307e\u3059\u3002\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b<\/p>\n<ul>\n<li>AWS IAM \u30ed\u30fc\u30eb (SendGridLambdaSample_lambda_function)<\/li>\n<li>AWS IAM \u30dd\u30ea\u30b7\u30fc (SendGridLambdaSample_lambda_logs)<\/li>\n<\/ul>\n<p style=\"margin: 20px 0px;\">\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002hello\u3068\u3044\u3046\u30b5\u30f3\u30d7\u30eb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3082\u751f\u6210\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u30c7\u30d7\u30ed\u30a4\u3068\u52d5\u4f5c\u78ba\u8a8d\u3092\u3057\u307e\u3059\u3002(AWS\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u3054\u5229\u7528\u306e\u5834\u5408\u306f\u3001&#8211;profile &lt;\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u540d&gt;\u3067\u30a2\u30af\u30bb\u30b9\u8a8d\u8a3c\u60c5\u5831\u3068\u30ea\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ apex --region ap-northeast-1 deploy\r\n$ apex invoke hello --dry-run\r\n\r\n{&quot;hello&quot;:&quot;world&quot;}\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u3053\u308c\u306b\u3088\u308a\u3001SendGridLambdaSample_hello\u3068\u3044\u3046\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u6700\u5f8c\u306b\u3001.zip\u306e\u30c7\u30d7\u30ed\u30a4\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f\u30d0\u30a4\u30ca\u30ea\u306e\u307f\u683c\u7d0d\u3057\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u81ea\u4f53\u306f\u9664\u5916\u3059\u308b\u76ee\u7684\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30easendgrid-lambda-sample\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u306e\u30d5\u30a1\u30a4\u30eb.apexignore\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n*.go\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u4ee5\u4e0a\u3067\u3001Apex \u306e\u6e96\u5099\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3: \u30e1\u30fc\u30eb\u9001\u4fe1\b<\/h3>\n<p style=\"margin: 20px 0px;\">\u3055\u3066\u6b21\u306f\u3001Go\u8a00\u8a9e\u5411\u3051\u306eSendGrid<a href=\"https:\/\/github.com\/sendgrid\/sendgrid-go\" target=\"_blank\">\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>\u3092\u7528\u3044\u3066\u3001 \u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3059\u3002SendGrid\u306e<a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/Tutorials\/A_Transaction_Mail\/manage_api_key.html\" target=\"_blank\">API\u30ad\u30fc<\/a>\u3092\u4e88\u3081\u53d6\u5f97\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul style=\"margin: 20px;\">\n<li>SENDGRID_API_KEY\uff1aSendGrid \u306eAPI Key\uff08Mail Send\u3078\u306eFULL ACCESS\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u304c\u5fc5\u8981\uff09<\/li>\n<\/ul>\n<p style=\"margin: 20px 0px;\">\u4ee5\u4e0b\u306e\u95a2\u6570\u3067\u306f\u3001SendGrid\u306e<a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/API_Reference\/Web_API_v3\/Mail\/index.html\" target=\"_blank\">Web API v3<\/a>\u3092\u7528\u3044\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u3044\u307e\u3059\u3002\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u7528\u3044\u308b\u3068\u3001\u30e1\u30fc\u30eb\u672c\u6587\u3084\u30d8\u30c3\u30c0\u3001\u30e1\u30bf\u30c7\u30fc\u30bf\u3084\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u7b49\u3001<a href=\"https:\/\/sendgrid.com\/docs\/API_Reference\/Web_API_v3\/Mail\/index.html#-Request-Body-Parameters\" target=\"_blank\">SendGrid\u306b\u9001\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u5185\u5bb9<\/a>\u3092\u3001\u7c21\u5358\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">functions\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bsend\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092main.go\u3068\u3057\u3066send\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002 (\u7d19\u9762\u306e\u90fd\u5408\u4e0a\u3001\u5927\u90e8\u5206\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u7701\u7565\u3057\u3066\u3044\u307e\u3059)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npackage main\r\n\r\nimport (\r\n    &quot;encoding\/base64&quot;\r\n    &quot;encoding\/json&quot;\r\n    &quot;io\/ioutil&quot;\r\n    &quot;os&quot;\r\n\r\n    apex &quot;github.com\/apex\/go-apex&quot;\r\n    apexs3 &quot;github.com\/apex\/go-apex\/s3&quot;\r\n    &quot;github.com\/aws\/aws-sdk-go\/aws&quot;\r\n    &quot;github.com\/aws\/aws-sdk-go\/aws\/credentials&quot;\r\n    &quot;github.com\/aws\/aws-sdk-go\/aws\/session&quot;\r\n    &quot;github.com\/aws\/aws-sdk-go\/service\/s3&quot;\r\n    &quot;github.com\/sendgrid\/sendgrid-go&quot;\r\n    &quot;github.com\/sendgrid\/sendgrid-go\/helpers\/mail&quot;\r\n)\r\n\r\nfunc main() {\r\n    apex.HandleFunc(func(event json.RawMessage, ctx *apex.Context) (interface{}, error) {\r\n        \/\/ \u30a4\u30d9\u30f3\u30c8\u5185\u5bb9\u3092\u53d6\u5f97\r\n        var msg apexs3.Event\r\n        if err := json.Unmarshal(event, &amp;msg); err != nil {\r\n            return nil, err\r\n        }\r\n\r\n        \/\/ \u30e1\u30fc\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\r\n        m := mail.NewV3Mail()\r\n\r\n        \/\/ \u9001\u4fe1\u5143\r\n        m.SetFrom(mail.NewEmail(&quot;\u606f\u5b50&quot;, &quot;yourson@example.com&quot;))\r\n        \r\n        \/\/ \u4ef6\u540d\r\n        m.Subject = &quot;\u65b0\u3057\u3044\u5199\u771f\u3060\u3088&quot;\r\n\r\n        \/\/ \u30e1\u30fc\u30eb\u672c\u6587\r\n        m.AddContent(\r\n            mail.NewContent(&quot;text\/plain&quot;, &quot;\u5b6b\u306e\u5199\u771f\u3092\u9001\u308b\u3088\u3002\u611f\u60f3\u3092\u805e\u304b\u305b\u3066\u306d\u3002&quot;),\r\n            mail.NewContent(&quot;text\/html&quot;, &quot;\u5b6b\u306e\u5199\u771f\u3092\u9001\u308b\u3088\u3002\u611f\u60f3\u3092\u805e\u304b\u305b\u3066\u306d\u3002&quot;),\r\n        )\r\n\r\n        \/\/ \u30d1\u30fc\u30bd\u30ca\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3 (\u5b9b\u5148)\r\n        p := mail.NewPersonalization()\r\n        p.AddTos(\r\n            mail.NewEmail(&quot;\u304a\u3058\u3044\u3061\u3083\u3093&quot;, &quot;grampa@example.com&quot;),\r\n            mail.NewEmail(&quot;\u304a\u3070\u3042\u3061\u3083\u3093&quot;, &quot;gramma@example.com&quot;),\r\n        )\r\n        m.AddPersonalizations(p)\r\n\r\n        \/\/ S3\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u53d6\u5f97\r\n        region := msg.Records&#x5B;0].AWSRegion\r\n        cred := credentials.NewEnvCredentials()\r\n        svc := s3.New(\r\n            session.New(),\r\n            aws.NewConfig().WithCredentials(cred).WithRegion(region),\r\n        )\r\n        out, _ := svc.GetObject(&amp;s3.GetObjectInput{\r\n            Bucket: aws.String(msg.Records&#x5B;0].S3.Bucket.Name),\r\n            Key:    aws.String(msg.Records&#x5B;0].S3.Object.Key),\r\n        })\r\n        defer out.Body.Close()\r\n        data, _ := ioutil.ReadAll(out.Body)\r\n\r\n        \/\/ \u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\r\n        a := mail.NewAttachment()\r\n        a.SetContent(base64.StdEncoding.EncodeToString(data))\r\n        a.SetFilename(msg.Records&#x5B;0].S3.Object.Key)\r\n        m.AddAttachment(a)\r\n\r\n        \/\/ \u30ea\u30af\u30a8\u30b9\u30c8\r\n        apiKey := os.Getenv(&quot;SENDGRID_API_KEY&quot;)\r\n        req := sendgrid.GetRequest(apiKey, &quot;\/v3\/mail\/send&quot;, &quot;https:\/\/api.sendgrid.com&quot;)\r\n        req.Method = &quot;POST&quot;\r\n        req.Body = mail.GetRequestBody(m)\r\n\r\n        \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\r\n        res, _ := sendgrid.API(req)\r\n        return res.Body, nil\r\n    })\r\n}\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">send\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bfunction.json\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3001 SendGrid\u306eAPI\u30ad\u30fc\u3092\u8a18\u5165\u3059\u308b\u3068\u3001AWS Lambda\u4e0a\u306e\u74b0\u5883\u5909\u6570\u304c\u81ea\u52d5\u7684\u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{\r\n  &quot;environment&quot;: {\r\n    &quot;SENDGRID_API_KEY&quot;: &quot;XXXXXXXXXXXXXXXXXXXXXX&quot;\r\n  }\r\n}\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u3053\u306e\u72b6\u614b\u3067\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u3068\u3001AWS Lambda\u4e0a\u306bSendGridLambdaSample_send \u3068\u3044\u3046\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u304c\u3067\u304d\u3042\u304c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ apex --region ap-northeast-1 deploy\r\n<\/pre>\n<h3>\u30c8\u30ea\u30ac\u30fc\u306e\u8a2d\u5b9a<\/h3>\n<p style=\"margin: 20px 0px;\">Amazon S3 \u306b\u30d5\u30a1\u30a4\u30eb\u304c\u683c\u7d0d\u3055\u308c\u308b\u3068AWS Lambda \u306b\u901a\u77e5\u3059\u308b\u3088\u3046\u306b<a href=\"http:\/\/docs.aws.amazon.com\/ja_jp\/AmazonS3\/latest\/dev\/NotificationHowTo.html\" target=\"_blank\">\u8a2d\u5b9a<\/a>\u3092\u884c\u3044\u307e\u3059\u3002\u307e\u305a\u753b\u50cf\u3092\u683c\u7d0d\u3059\u308b\u30d0\u30b1\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001sendgridlambdasample \u3068\u3044\u3046\u540d\u524d\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ aws s3api create-bucket \\\r\n    --bucket sendgridlambdasample \\\r\n    ---region ap-northeast-1 \\\r\n    ---create-bucket-configuration LocationConstraint=ap-northeast-1\r\n{\r\n    &quot;Location&quot;: &quot;\/sendgridattachments&quot;\r\n}\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">S3\u306e\u30d0\u30b1\u30c3\u30c8sendgridlambdasample\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u30c8\u30ea\u30ac\u30fc\u3068\u3057\u3066\u3001 \u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3SendGridLambdaSample_send\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002AWS \u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u3067\u306f\u3001<\/p>\n<ul style=\"margin: 20px;\">\n<li>Lambda &gt; Functions &gt; SendGridSample_send<\/li>\n<\/ul>\n<p style=\"margin: 20px 0px;\">\u3068\u9032\u307f\u3001\u300cTriggers\u300d\u30bf\u30d6\u3092\u9078\u629e\u3057\u3066\u300cAdd trigger\u300d\u304b\u3089\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<ul style=\"margin: 20px;\">\n<li>Bucket: sendgridlambdasample<\/li>\n<li>Event type: Object Created (All) \u3082\u3057\u304f\u306f Put<\/li>\n<li>Prefix: \u306a\u3057<\/li>\n<li>Suffix: jpg<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/02\/Trigger.png\" alt=\"Trigger\" width=\"100%\" \/><\/p>\n<p style=\"margin: 20px 0px;\">\u306a\u304a\u3001AWS\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3067\u306f\u3001\u307e\u305aAWS Lambda\u5074\u306b\u6a29\u9650\u3092\u4ed8\u4e0e\u3057\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ aws lambda add-permission \\\r\n    --function-name &quot;SendGridLambdaSample_send&quot; \\\r\n    --statement-id &quot;s3-put-event&quot; \\\r\n    ---action &quot;lambda:InvokeFunction&quot; \\\r\n    ---principal &quot;s3.amazonaws.com&quot; \\\r\n    ---source-arn &quot;arn:aws:s3:::sendgridlambdasample&quot;\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u305d\u3057\u3066S3\u306e\u30d0\u30b1\u30c3\u30c8\u306b\u901a\u77e5\u30a4\u30d9\u30f3\u30c8\u3092\u4ed5\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ aws s3api put-bucket-notification-configuration \\\r\n    --bucket &quot;sendgridlambdasample&quot; \\\r\n    ---notification-configuration &quot;LambdaFunctionConfigurations\\&quot;:&#x5B;{\\&quot;LambdaFunctionArn\\&quot;:\\&quot;arn:aws:lambda:ap-northeast-1:xxxxxxxxxxxx:function:SendGridLambdaSample_send\\&quot;,\\&quot;Events\\&quot;:&#x5B;\\&quot;s3:ObjectCreated:Put\\&quot;],\\&quot;Filter\\&quot;:{\\&quot;Key\\&quot;:{\\&quot;FilterRules\\&quot;:&#x5B;{\\&quot;Name\\&quot;:\\&quot;suffix\\&quot;,\\&quot;Value\\&quot;:\\&quot;jpg\\&quot; }]}}}]\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u4e0a\u306e&#8211;notification-configuration\u306e\u5185\u5bb9\u306f\u3001 AWS\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u306e<a href=\"http:\/\/docs.aws.amazon.com\/cli\/latest\/reference\/s3api\/put-bucket-notification.html\" target=\"_blank\">\u30de\u30cb\u30e5\u30a2\u30eb<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30e1\u30fc\u30eb\u9001\u4fe1<\/h3>\n<p style=\"margin: 20px 0px;\">\u8a66\u3057\u306b\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ aws s3 cp grandson.jpg s3:\/\/sendgridlambdasample\/grandson.jpg\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u78ba\u304b\u306b\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3057\u305f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/02\/mail.png\" alt=\"AWS Lambda\u304b\u3089SendGrid\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\" width=\"100%\" \/><\/p>\n<h3>\u5b9f\u8a71: \u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30a9\u30f3\u306e\u5f85\u53d7\u753b\u50cf\u306b<\/h3>\n<p style=\"margin: 20px 0px;\">\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u304c\u7206\u767a\u7684\u306b\u666e\u53ca\u3057\u305f\u3068\u306f\u3044\u3048\u3001 \u73fe\u5728\u306e\u65e5\u672c\u3067\u306f\uff12\u5272\u7a0b\u306e\u65b9\u304c\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30a9\u30f3\u3092\u7d99\u7d9a\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u8001\u82e5\u7537\u5973\u3092\u554f\u308f\u305a\u3001\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306e\u5229\u7528\u306b\u4e8c\u306e\u8db3\u3092\u8e0f\u3080\u65b9\u3082\u4e00\u5b9a\u6570\u3044\u3089\u3063\u3057\u3083\u3044\u307e\u3059\u3002 \u5148\u307b\u3069\u306e\u753b\u50cf\u306f 3.5 MB\u3067\u3057\u305f\u304c\u3001 \u6628\u4eca\u306e\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u3067\u64ae\u5f71\u3057\u305f\u5199\u771f\u306f\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c\u5927\u304d\u3059\u304e\u3066\u3001 \u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30a9\u30f3\u3067\u306f\u4fdd\u5b58\u306f\u304a\u308d\u304b\u95b2\u89a7\u3082\u56f0\u96e3\u3067\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">\u3067\u3059\u304b\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u308b\u306e\u3082\u9837\u3051\u307e\u3059\uff1a<\/p>\n<blockquote><p>\u6bce\u65e5\u4f7f\u3063\u3066\u3044\u308b\u643a\u5e2f\u3060\u304b\u3089\u3053\u305d\u3001\u5f85\u53d7\u753b\u9762\u306b\u306f\u5b6b\u306e\u5199\u771f\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u3002\u3067\u304d\u308c\u3070\u3001\u307b\u307c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u5199\u771f\u3092\u9001\u3063\u3066\u307b\u3057\u3044\u306e\u3060\u3051\u3069\u3002<\/p><\/blockquote>\n<p style=\"margin: 20px 0px;\">\u3069\u3093\u306a\u30e2\u30d0\u30a4\u30eb\u7aef\u672b\u3067\u3042\u3063\u3066\u3082\u3001\u305f\u3044\u3066\u3044\u306e\u5834\u5408\u3001\u30e1\u30fc\u30eb\u306e\u3084\u308a\u3068\u308a\u306f\u53ef\u80fd\u3067\u3059\u3002\u3067\u3059\u304b\u3089\u3001\u65e2\u306b\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u3044\u308b\u30e1\u30fc\u30eb\u9001\u4fe1\u7528\u306e\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u306b\u52a0\u3048\u3066\u3001 \u5199\u771f\u3092\u30ea\u30b5\u30a4\u30ba\u3059\u308b\u8ffd\u52a0\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308c\u3070\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u7b54\u3048\u3089\u308c\u305d\u3046\u3067\u3059\u3002 (\u4f59\u8ac7\u3067\u3059\u304c\u3001\u4f01\u696d\u3084\u30c7\u30d0\u30a4\u30b9\u306e\u57a3\u6839\u3092\u8d8a\u3048\u3066\u3001 \u3053\u3053\u307e\u3067\u4e16\u306e\u4e2d\u306b\u6df1\u304f\u6d78\u900f\u3057\u3066\u3044\u308b\u30e1\u30fc\u30eb\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306f\u5947\u8de1\u7684\u306b\u601d\u3048\u307e\u3059\u3002) \u30d0\u30b1\u30c3\u30c8(\u4f8b\u3048\u3070\u3001sendgridlambdasampleoriginal)\u3078\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3092\u30c8\u30ea\u30ac\u30fc\u306b\u3057\u3066\u3001\u30ea\u30b5\u30a4\u30ba\u3057\u305f\u5199\u771f\u3092\u5148\u307b\u3069\u306e\u30d0\u30b1\u30c3\u30c8(sendgridlambdasample)\u306b\u4fdd\u5b58\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002 (\u7d19\u9762\u306e\u90fd\u5408\u4e0a\u3001\u5927\u90e8\u5206\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u7701\u7565\u3057\u3066\u3044\u307e\u3059)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\npackage main\r\n\r\nimport(\r\n    ...\r\n    apexs3 &quot;github.com\/apex\/go-apex\/s3&quot;\r\n    &quot;github.com\/nfnt\/resize&quot;\r\n)\r\n\r\nfunc main() {\r\n    apex.HandleFunc(func(event json.RawMessage, ctx *apex.Context) (interface{}, error) {\r\n        \/\/ \u30a4\u30d9\u30f3\u30c8\u306e\u5185\u5bb9\u3092\u53d6\u5f97\r\n        var msg apexs3.Event\r\n        if err := json.Unmarshal(event, &amp;msg); err != nil {\r\n            return nil, err\r\n        }\r\n\r\n        \/\/ S3\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\r\n        region := msg.Records&#x5B;0].AWSRegion\r\n        cred := credentials.NewEnvCredentials()\r\n        bucket := msg.Records&#x5B;0].S3.Bucket.Name\r\n        key := msg.Records&#x5B;0].S3.Object.Key\r\n        svc := s3.New(\r\n            session.New(),\r\n            aws.NewConfig().WithCredentials(cred).WithRegion(region),\r\n        )\r\n        out, _ := svc.GetObject(&amp;s3.GetObjectInput{\r\n            Bucket: aws.String(bucket),\r\n            Key:    aws.String(key),\r\n        })\r\n        defer out.Body.Close()\r\n\r\n        \/\/ \u753b\u50cf\u3092\u30c7\u30b3\u30fc\u30c9\r\n        img, _ := jpeg.Decode(out.Body)\r\n\r\n        \/\/ \u30ea\u30b5\u30a4\u30ba\r\n        resizedImg := resize.Resize(480, 0, img, resize.Lanczos3)\r\n\r\n        \/\/ \u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u305f\u753b\u50cf\u3092\u4fdd\u5b58\r\n        file, _ := os.Create(&quot;\/tmp\/&quot; + key)\r\n        defer file.Close()\r\n\r\n        if err := jpeg.Encode(file, resizedImg, nil); err != nil {\r\n            return nil, err\r\n        }\r\n        post, _ := svc.PutObject(&amp;s3.PutObjectInput{\r\n            Bucket: aws.String(&quot;sendgridlambdasample&quot;),\r\n            Key:    aws.String(key),\r\n            Body:   file,\r\n        })\r\n\r\n        return post.String(), nil\r\n    })\r\n}\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u753b\u50cf\u30b5\u30a4\u30ba\u306e\u7e2e\u5c0f\u306b\u306f\u3001<a href=\"https:\/\/github.com\/nfnt\/resize\" target=\"_blank\">nfnt\/resize<\/a>\u3092\u5229\u7528\u3057\u307e\u3057\u305f\u3002 \u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u307f\u308b\u3068\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ aws s3 cp grandson.jpg s3:\/\/sendgridlambdasampleoriginal\/grandson.jpg\r\n<\/pre>\n<p style=\"margin: 20px 0px;\">\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306a\u5199\u771f\u304c\u5c4a\u304d\u307e\u3057\u305f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2017\/02\/mail2.png\" alt=\"AWS Lambda\u304b\u3089\bSendGrid\u3067\u30e1\u30fc\u30eb\u9001\u4fe1 +\balpha\" width=\"100%\" \/><\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p style=\"margin: 20px 0px;\">\u672c\u65e5\u306f\u3001SendGrid\u306e\u516c\u5f0f\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5229\u7528\u4f8b\u3068\u3057\u3066\u3001FaaS \u4e0a\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u30c4\u30fc\u30eb(+\u03b1)\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002\u81ea\u524d\u3067\u30b5\u30fc\u30d0\u3092\u7528\u610f\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u6c17\u8efd\u306b\u305d\u3057\u3066\u7d20\u65e9\u304f\u304a\u8a66\u3057\u3044\u305f\u3060\u3051\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin: 20px 0px;\">SendGrid\u306f\u5927\u898f\u6a21\u306a\u30e1\u30fc\u30eb\u914d\u4fe1\u3092\u78ba\u5b9f\u306b\u5b9f\u73fe\u3059\u308b\u69d8\u3005\u306a\u6a5f\u80fd\u3092API\u3067\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002 \u307e\u305f\u3001\u5404\u7a2e\u8a00\u8a9e\u306e<a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/Integrate\/libraries.html\" target=\"_blank\">API\u30e9\u30a4\u30d6\u30e9\u30ea<\/a>\u3082\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002 \u307f\u306a\u3055\u3093\u3082\u305c\u3072\u72ec\u81ea\u306e\u4fbf\u5229\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SendGrid\u30c6\u30af\u30cb\u30ab\u30eb\u30b5\u30dd\u30fc\u30c8\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u6d25\u7530\u3067\u3059\u3002\u3053\u3053\u6570\u5e74\u3001FaaS (Function as a Service) \u306e\u8a71\u984c\u3092\u3088\u304f\u8033\u306b\u3057\u307e\u3059\u3002AWS Lambda\u3001Google Cloud Functions\u3001Mi <a class=\"read-more\" href=\"https:\/\/sendgrid.kke.co.jp\/blog\/?p=7496\">&#8230;\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":10,"featured_media":1242,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-7496","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\/7496","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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7496"}],"version-history":[{"count":57,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7496\/revisions"}],"predecessor-version":[{"id":18382,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7496\/revisions\/18382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/media\/1242"}],"wp:attachment":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}