-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug with partials in email templates #2231
Comments
Sorry to hear about this issue. Unfortunately I don't think we had tested partials in email templates much, or at least I don't recall testing that very much. I could see this being a fairly easy fix. Would be happy to merge in a fix if someone sees this and decides to take a crack at it and open a PR. |
CyberFerret
added a commit
to CyberFerret/padrino-framework
that referenced
this issue
Oct 11, 2020
… partials in email templates As per padrino#2231, when using multiple partials within an email template, the mailer name keeps getting added to the file path for each subsequent partial in the same template, resulting in an `Errno::ENOENT: No such file or directory @ rb_sysopen` error. Added a check to `settings.view` in the render routine to see if the mailer path was already in the string before adding it.
maysam
pushed a commit
to HR-Partner/padrino-framework
that referenced
this issue
Jul 24, 2021
… partials in email templates As per padrino#2231, when using multiple partials within an email template, the mailer name keeps getting added to the file path for each subsequent partial in the same template, resulting in an `Errno::ENOENT: No such file or directory @ rb_sysopen` error. Added a check to `settings.view` in the render routine to see if the mailer path was already in the string before adding it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Padrino 0.14.4 running on Ruby 2.5, I am using
partial
to add HAML snippets into emails I am sending out using Mailer.Folder structure is as follows:
So I set up within
worker_mailer.rb
:(Side note: Wish we could use the
locals
declaration within the email block, but it looks like if we are rendering using templates, we have to move thelocals
to a parameter within therender
line?!)Then in the
my_email.haml
template, I have partials within the document like so:However when trying to send the email, I am getting the error:
(Note the duplicated 'worker_mailer' folder in the error message).
If I then try and create a subfolder called 'worker_mailer' under the existing 'worker_mailer' folder and put
_snippet1.haml
in there, then the first line will pass OK, but it throws an error on the next partial with:(Note that the 'worker_mailer' folder appears to be recursively adding to itself for each partial in the template!)
I've tried hard coding the path to the partial template, but with no success. The rendering routine seems to want to keep adding another 'worker_mailer' to the parent folder for each subsequent partial. i.e.:
still doesn't work.
Is this a bug in
rendering.rb
or am I doing something wrong?The text was updated successfully, but these errors were encountered: