Open Lazarus404 opened 8 years ago
Could it be that it's because of the plug :action that is given in the addict controller? I had a similar problem with login. Maybe it's default in phoenix now?
It seems to be those email templates, again... It would be good to have a little write up on these. Perhaps explaining where to look so you know what parameters are made available to include in the templates. I think that should be sufficient.
So, tracking down the issue; in Addict.Mailers.MailSender.convert_to_list, this is returned:
[username: "lee@domain.com", type: "client", tel: "0234567890",
sector: "Management",
encrypted_password: "$pbkdf2-sha512$160000$VNuu8F9Mz9DglMpcAgdJBw$fbU349xWvlsioZEExDVCYSp1TqhEVQeVn4DtY4d3BD3rnYrXCL3oxqBz5ft8iwlRKupiYFJmlBjWYpVjPIoInA",
email: "lee@domain.com", country: "NZ"]
but, the module errors with
[error] #PID<0.428.0> running Pickpro.Endpoint terminated
Server: localhost:4000 (http)
Request: POST /register
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in EEx.Tokenizer.tokenize/5
(eex) lib/eex/tokenizer.ex:27: EEx.Tokenizer.tokenize(#Function<20.50752066/0 in :erl_eval.expr/5>, 1, [trim: false], [], [])
(eex) lib/eex/compiler.ex:16: EEx.Compiler.compile/2
(eex) lib/eex.ex:191: EEx.eval_string/3
lib/addict/mailers/mail_sender.ex:13: Addict.Mailers.MailSender.send_register/1
I'm gonna see if I can work out why, but any help appreciated. The template I'm using is just a string. It doesn't include any parameters whatsoever.
Thanks
@Lazarus404 can you please share the config piece at config.exs
that sets the value for email_register_template
and the source of what it is pointing at?
Here's my test run:
iex(1)> defmodule Foo do
...(1)> def template_register do
...(1)> "some simple string"
...(1)> end
...(1)> end
{:module, Foo,
<<70, 79, 82, 49, 0, 0, 5, 20, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 140, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>,
{:template_register, 0}}
iex(2)> payload = [username: "lee@domain.com", type: "client", tel: "0234567890", sector: "Management", encrypted_password: "$pbkdf2-sha512$160000$VNuu8F9Mz9DglMpcAgdJBw$fbU349xWvlsioZEExDVCYSp1TqhEVQeVn4DtY4d3BD3rnYrXCL3oxqBz5ft8iwlRKupiYFJmlBjWYpVjPIoInA", email: "lee@domain.com", country: "NZ"]
[username: "lee@domain.com", type: "client", tel: "0234567890",
sector: "Management",
encrypted_password: "$pbkdf2-sha512$160000$VNuu8F9Mz9DglMpcAgdJBw$fbU349xWvlsioZEExDVCYSp1TqhEVQeVn4DtY4d3BD3rnYrXCL3oxqBz5ft8iwlRKupiYFJmlBjWYpVjPIoInA",
email: "lee@domain.com", country: "NZ"]
iex(3)> EEx.eval_string Foo.template_register, payload
"some simple string"
iex(4)>
Thanks!
Hi,
So, I've got Addict set up nicely, but I've noticed an error occurs silently when calling /recover_password:
I'm using Phoenix 1.1 and I've forced the Ecto version to 1.1.1, so this might be the issue.