beam-community / bamboo

Testable, composable, and adapter based Elixir email library for devs that love piping.
https://hex.pm/packages/bamboo
MIT License
1.91k stars 345 forks source link

It raises an error in production with version 1.3.0 #509

Closed sunloverz closed 4 years ago

sunloverz commented 4 years ago

It works fine locally but it doesn't send reset password email on production. And it's not clear what is wrong since bamboo doesn't print error messages.

2019-12-24T12:59:07.543365590Z 12:59:07.542 [error] GenServer #PID<0.4926.0> terminating
2019-12-24T12:59:07.543401149Z ** (Bamboo.ApiError) There was a problem sending the email through the SendGrid API.
2019-12-24T12:59:07.543424863Z 
2019-12-24T12:59:07.543429426Z Here is the response:
2019-12-24T12:59:07.543433452Z 
2019-12-24T12:59:07.543440369Z "<html>\n  <head>\n    <title>SendGrid - 400 Bad Request</title>\n    <style>@import url(\"https://fonts.googleapis.com/css?family=Dosis:300,400,700,800\");/** Styles for the 403 Page **/.particle-error,.permission_denied,#particles-js {  width: 100%;  height: 100%;  margin: 0px !important;}#particles-js {  position: fixed !important;  opacity: 0.23;}.permission_denied {  background: #294661 !important;}.permission_denied a {  text-decoration: none;}.denied__wrapper {  max-width: 390px;  width: 100%;  height: 390px;  display: block;  margin: 0 auto;  position: relative;  margin-top: 8vh;}.permission_denied h1 {  text-align: center;  color: #fff;  font-family: \"Dosis\", sans-serif;  font-size: 100px;  margin-bottom: 0px;  font-weight: 800;}.permission_denied h3 {  text-align: center;  color: #fff;  font-size: 19px;  line-height: 23px;  max-width: 330px;  margin: 0px auto 30px auto;  font-family: \"Dosis\", sans-serif;  font-weight: 400;}.permission_denied h3 span {  position: relative;  width: 65px;  display: inline-block;}.permission_denied h3 span:after {  content: \"\";  border-bottom: 3px solid #e12127;  position: absolute;  left: 0;  top: 43%;  width: 100%;}.denied__link {  background: none;  color: #fff;  padding: 12px 0px 10px 0px;  border: 1px solid #fff;  outline: none;  border-radius: 7px;  width: 150px;  width: 150px;  font-size: 15px;  text-align: center;  margin: 0 auto;  vertical-align: middle;  display: block;  margin-bottom: 40px;  margin-top: 25px;  font-family: \"Dosis\", sans-serif;  font-weight: 400;}.denied__link:hover {  color: #e12127;  border-color: #e12127;  cursor: pointer;  opacity: 1;}.permission_denied .stars {  animation: sparkle 1.6s infinite ease-in-out alternate;}@keyframes sparkle {  0% {    opacity: 1;  }  100% {    opacity: 0.3;  }}#astronaut {  width: 43px;  position: absolute;  right: 20px;  top: 210px;  animation: spin 4.5s infinite linear;}@keyframes spin {  0% {    transform: rotateZ(0deg);  }  100% {    transform: rotateZ(360deg);  }}@media (max-width: 600px) {  .permission_denied h1 {    font-size: 75px;  }  .permission_denied h3 {    font-size: 16px;    width: 200px;    margin: 0 auto;    line-height: 23px;  }  .permission_denied h3 span {    width: 60px;  }  #astronaut {    width: 35px;    right: 40px;    top: 170px;  }}.saturn,.saturn-2,.hover {  animation: hover 2s infinite ease-in-out alternate;}@keyframes hover {  0% {    transform: translateY(3px);  }  100% {    transform: translateY(-3px);  }\n    } </style>\n  </head>\n  <body class=\"permission_denied\">\n    <div id=\"particles-js\"></div>\n    <div class=\"denied__wrapper\">\n      <h1>400</h1>\n      <h3>Ngnix - Bad Request</h3>\n      <svg id=\"astronaut\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\">\n        <g id=\"tiara-logo\" transform=\"translate(8.000000, 8.000000)\">\n          <rect id=\"99E1F4\" fill=\"#99E1F4\" x=\"8\" y=\"16\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"99E1F4\" fill=\"#99E1F4\" x=\"0\" y=\"8\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"009DD9\" fill=\"#009DD9\" x=\"8\" y=\"8\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"00B3E3\" fill=\"#00B3E3\" x=\"16\" y=\"8\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"00B3E3\" fill=\"#00B3E3\" x=\"8\" y=\"0\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"1a82e2\" fill=\"#1A82E2\" x=\"0\" y=\"16\" width=\"8\" height=\"8\"></rect>\n          <rect id=\"1a82e2\" fill=\"#1A82E2\" x=\"16\" y=\"0\" width=\"8\" height=\"8\"></rect>\n        </g>\n      </svg>\n      <svg id=\"planet\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n      <circle class=\"saturn\" cx=\"256\" cy=\"256\" r=\"149.536\" fill=\"#FFF\"/>\n      <circle class=\"saturn\" cx=\"256\" cy=\"256\" r=\"138\" fill=\"#e12127\"/>\n      <circle class=\"saturn\" cx=\"256\" cy=\"256\" r=\"108\" fill=\"#FFF\"/>\n      <circle class=\"hover\" cx=\"216\" cy=\"214.081\" r=\"32\" fill=\"#e12127\"/>\n      <circle class=\"hover\" cx=\"298\" cy=\"214.081\" r=\"32\" fill=\"#e12127\"/>\n      <circle class=\"hover\" cx=\"216\" cy=\"296.081\" r=\"32\" fill=\"#e12127\"/>\n      <circle class=\"hover\" cx=\"298\" cy=\"296.081\" r=\"32\" fill=\"#e12127\"/>\n      <path class=\"stars\" fill=\"#FFF\" d=\"M112.456 363.093c-.056 7.866-6.478 14.1" <> ...
2019-12-24T12:59:07.543495417Z 
2019-12-24T12:59:07.543499383Z Here are the params we sent:
2019-12-24T12:59:07.543502713Z 
2019-12-24T12:59:07.543506Z %{"content" => [%{"type" => "text/plain", "value" => "You have requested to change your hotcr password.\n\nPlease use the following link to reset your password:\n\nhttp://hotcr.co:4000/reset-password/fac85f57-ad3e-4b8a-9c06-05299b4964e2\nIf you do not want to change your password or you did not make this request, please ignore this message.\n"}, %{"type" => "text/html", "value" => "<p>Hello,</p>\n<p>You have requested to change your hotcr password.</p>\n<p>Click here or copy and paste the following link to create a new password:</p>\n<p><a href=\"http://hotcr.co:4000/reset-password/fac85f57-ad3e-4b8a-9c06-05299b4964e2\">http://hotcr.co:4000/reset-password/fac85f57-ad3e-4b8a-9c06-05299b4964e2</a></p>\n<p>If you do not want to change your password or you did not make this request, please ignore this message.</p>\n<p>Hope to see you soon,</p>\n<p>Hotcr</p>\n"}], "from" => %{"email" => "hotcr@mail.hotcr.com"}, "key" => "[FILTERED]", "personalizations" => [%{"to" => [%{"email" => "sunloverz@gmail.com"}]}], "subject" => "Reset password instructions"}
2019-12-24T12:59:07.543516426Z 
2019-12-24T12:59:07.543519595Z     (bamboo) lib/bamboo/api_error.ex:63: Bamboo.ApiError.raise_api_error/4
2019-12-24T12:59:07.543523045Z     (bamboo) lib/bamboo/mailer.ex:145: Bamboo.Mailer.deliver_now/4
germsvel commented 4 years ago

Hi @sunloverz, thanks for opening this issue! I'm just starting to maintain Bamboo. Is this still an error that you're running into? Is there any other information you could provide so we can reproduce the error?

sunloverz commented 4 years ago

I managed to fix this issue, it wasn't related to bamboo, thanks!