How to fix 'render/2 is undefined' error using Bamboo with PhoenixSend email from localhost running XAMMP in PHP using GMAIL mail serverHow can I schedule code to run every few hours in Elixir or Phoenix framework?Halt a connection after a redirectPhoenix error in deployment: module Connection is not availablePHP Send emails to multiple addresses with amazon SESHow do you post a Map to Phoenix using JSON?How do I load environment variables for a phoenix framework projectPhoenix.Template.UndefinedError when rendering templates - Phoenix 1.3send_download undefined in phoenixPhoenix not loading View module
Can a dragon's breath weapon pass through Leomund's Tiny Hut?
What was the average temperature of space where the Spitzer Satellite Telescope was orbiting?
Interviewing with an unmentioned 9 months of sick leave taken during a job
Arithmetics in LuaLaTeX
Are there any restrictions on how amendment should be related to original law in US Senate?
What was the difference between a Games Console and a Home Computer?
How to find location on Cambridge-Mildenhall railway that still has tracks/rails?
Using SPID in DB Tables (instead of Table Variable)
Is it legal for a supermarket to refuse to sell an adult beer if an adult with them doesn’t have their ID?
Why were these characters absent in Spider-Man: Far From Home?
How can electric field be defined as force per charge, if the charge makes its own, singular electric field?
Is it rude to refer to janitors as 'floor people'?
Random piece of plastic
How to belay quickly ascending top-rope climbers?
Time signature inconsistent
"Je suis petite, moi?", purpose of the "moi"?
Grouping into more groups in one iteration
Difference between c++14 and c++17 using: `*p++ = *p`
How did Jayne know when to shoot?
What would be the safest way to drop thousands of small, hard objects from a typical, high wing, GA airplane?
Locked-up DOS computer beeped on keypress. What mechanism caused that?
Alphanumeric Line and Curve Counting
Increasing muscle power without increasing volume
Term “console” in game consoles
How to fix 'render/2 is undefined' error using Bamboo with Phoenix
Send email from localhost running XAMMP in PHP using GMAIL mail serverHow can I schedule code to run every few hours in Elixir or Phoenix framework?Halt a connection after a redirectPhoenix error in deployment: module Connection is not availablePHP Send emails to multiple addresses with amazon SESHow do you post a Map to Phoenix using JSON?How do I load environment variables for a phoenix framework projectPhoenix.Template.UndefinedError when rendering templates - Phoenix 1.3send_download undefined in phoenixPhoenix not loading View module
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to send an email using a html email template with Bamboo (and Amazon SES) for my Phoenix/Elixir application
I've managed to get the email sending successfully using Bamboo's |> text_body(message) method. However I now want to be able to send a html template not just a string so I'm trying to use the render fn https://hexdocs.pm/bamboo/1.1.0/Bamboo.Phoenix.html#render/3 but I'm experiencing the following error: function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available). I get no error about my view when I use the text_body fn.
This is my fn:
def send_test_html_email(to_email_address, subject) do
new_email()
|> from("myemail@gmail.com")
|> to(to_email_address)
|> subject(subject)
|> render("email.html")
end
and this is the example fn from the docs:
def html_email do
new_email
|> render("html_email.html")
end
I can't see any difference and as I mentioned before, the rest of the fn was working fine with text_body as the last line instead of render.
My expected result is that the email will send without an error. My actual result is the function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available) error.
email elixir phoenix-framework
add a comment |
I'm trying to send an email using a html email template with Bamboo (and Amazon SES) for my Phoenix/Elixir application
I've managed to get the email sending successfully using Bamboo's |> text_body(message) method. However I now want to be able to send a html template not just a string so I'm trying to use the render fn https://hexdocs.pm/bamboo/1.1.0/Bamboo.Phoenix.html#render/3 but I'm experiencing the following error: function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available). I get no error about my view when I use the text_body fn.
This is my fn:
def send_test_html_email(to_email_address, subject) do
new_email()
|> from("myemail@gmail.com")
|> to(to_email_address)
|> subject(subject)
|> render("email.html")
end
and this is the example fn from the docs:
def html_email do
new_email
|> render("html_email.html")
end
I can't see any difference and as I mentioned before, the rest of the fn was working fine with text_body as the last line instead of render.
My expected result is that the email will send without an error. My actual result is the function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available) error.
email elixir phoenix-framework
2
Based on that error message, you have no module calledMyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?
– Justin Wood
Mar 26 at 15:21
1
What is the name of module that implementssend_test_html_emailfunction, and did you add lineuse Bamboo.Phoenix, view: MyApp.HtmlEmailViewin that module? Also, do you haveMyApp.HtmlEmailViewmodule?
– Milan Jaric
Mar 26 at 15:47
add a comment |
I'm trying to send an email using a html email template with Bamboo (and Amazon SES) for my Phoenix/Elixir application
I've managed to get the email sending successfully using Bamboo's |> text_body(message) method. However I now want to be able to send a html template not just a string so I'm trying to use the render fn https://hexdocs.pm/bamboo/1.1.0/Bamboo.Phoenix.html#render/3 but I'm experiencing the following error: function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available). I get no error about my view when I use the text_body fn.
This is my fn:
def send_test_html_email(to_email_address, subject) do
new_email()
|> from("myemail@gmail.com")
|> to(to_email_address)
|> subject(subject)
|> render("email.html")
end
and this is the example fn from the docs:
def html_email do
new_email
|> render("html_email.html")
end
I can't see any difference and as I mentioned before, the rest of the fn was working fine with text_body as the last line instead of render.
My expected result is that the email will send without an error. My actual result is the function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available) error.
email elixir phoenix-framework
I'm trying to send an email using a html email template with Bamboo (and Amazon SES) for my Phoenix/Elixir application
I've managed to get the email sending successfully using Bamboo's |> text_body(message) method. However I now want to be able to send a html template not just a string so I'm trying to use the render fn https://hexdocs.pm/bamboo/1.1.0/Bamboo.Phoenix.html#render/3 but I'm experiencing the following error: function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available). I get no error about my view when I use the text_body fn.
This is my fn:
def send_test_html_email(to_email_address, subject) do
new_email()
|> from("myemail@gmail.com")
|> to(to_email_address)
|> subject(subject)
|> render("email.html")
end
and this is the example fn from the docs:
def html_email do
new_email
|> render("html_email.html")
end
I can't see any difference and as I mentioned before, the rest of the fn was working fine with text_body as the last line instead of render.
My expected result is that the email will send without an error. My actual result is the function MyApp.HtmlEmailView.render/2 is undefined (module MyApp.HtmlEmailView is not available) error.
email elixir phoenix-framework
email elixir phoenix-framework
asked Mar 26 at 9:22
BlenBlen
1187 bronze badges
1187 bronze badges
2
Based on that error message, you have no module calledMyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?
– Justin Wood
Mar 26 at 15:21
1
What is the name of module that implementssend_test_html_emailfunction, and did you add lineuse Bamboo.Phoenix, view: MyApp.HtmlEmailViewin that module? Also, do you haveMyApp.HtmlEmailViewmodule?
– Milan Jaric
Mar 26 at 15:47
add a comment |
2
Based on that error message, you have no module calledMyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?
– Justin Wood
Mar 26 at 15:21
1
What is the name of module that implementssend_test_html_emailfunction, and did you add lineuse Bamboo.Phoenix, view: MyApp.HtmlEmailViewin that module? Also, do you haveMyApp.HtmlEmailViewmodule?
– Milan Jaric
Mar 26 at 15:47
2
2
Based on that error message, you have no module called
MyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?– Justin Wood
Mar 26 at 15:21
Based on that error message, you have no module called
MyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?– Justin Wood
Mar 26 at 15:21
1
1
What is the name of module that implements
send_test_html_email function, and did you add line use Bamboo.Phoenix, view: MyApp.HtmlEmailView in that module? Also, do you have MyApp.HtmlEmailView module?– Milan Jaric
Mar 26 at 15:47
What is the name of module that implements
send_test_html_email function, and did you add line use Bamboo.Phoenix, view: MyApp.HtmlEmailView in that module? Also, do you have MyApp.HtmlEmailView module?– Milan Jaric
Mar 26 at 15:47
add a comment |
1 Answer
1
active
oldest
votes
Thanks Justin Wood and Milan Jaric for your comments.
I was using: use Bamboo.Phoenix, view: MyApp.HtmlEmailView at the top of my module however the error was being caused as view: MyApp.HtmlEmailView needed to be view: MyAppWeb.HtmlEmailView. This has resolved the issue. Thank you for your help.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353584%2fhow-to-fix-render-2-is-undefined-error-using-bamboo-with-phoenix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks Justin Wood and Milan Jaric for your comments.
I was using: use Bamboo.Phoenix, view: MyApp.HtmlEmailView at the top of my module however the error was being caused as view: MyApp.HtmlEmailView needed to be view: MyAppWeb.HtmlEmailView. This has resolved the issue. Thank you for your help.
add a comment |
Thanks Justin Wood and Milan Jaric for your comments.
I was using: use Bamboo.Phoenix, view: MyApp.HtmlEmailView at the top of my module however the error was being caused as view: MyApp.HtmlEmailView needed to be view: MyAppWeb.HtmlEmailView. This has resolved the issue. Thank you for your help.
add a comment |
Thanks Justin Wood and Milan Jaric for your comments.
I was using: use Bamboo.Phoenix, view: MyApp.HtmlEmailView at the top of my module however the error was being caused as view: MyApp.HtmlEmailView needed to be view: MyAppWeb.HtmlEmailView. This has resolved the issue. Thank you for your help.
Thanks Justin Wood and Milan Jaric for your comments.
I was using: use Bamboo.Phoenix, view: MyApp.HtmlEmailView at the top of my module however the error was being caused as view: MyApp.HtmlEmailView needed to be view: MyAppWeb.HtmlEmailView. This has resolved the issue. Thank you for your help.
answered Mar 27 at 14:05
BlenBlen
1187 bronze badges
1187 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55353584%2fhow-to-fix-render-2-is-undefined-error-using-bamboo-with-phoenix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Based on that error message, you have no module called
MyApp.HtmlEmailView. Can you please double check that there is no typo in the module name, both at the call site and in the definition?– Justin Wood
Mar 26 at 15:21
1
What is the name of module that implements
send_test_html_emailfunction, and did you add lineuse Bamboo.Phoenix, view: MyApp.HtmlEmailViewin that module? Also, do you haveMyApp.HtmlEmailViewmodule?– Milan Jaric
Mar 26 at 15:47