-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Adding a section to emailing showing off absolute_url #4941
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,21 @@ an email is pretty straightforward:: | |
} | ||
|
||
To keep things decoupled, the email body has been stored in a template and | ||
rendered with the ``renderView()`` method. | ||
rendered with the ``renderView()`` method. The ``registration.html.twig`` | ||
template might look something like this: | ||
|
||
.. code-block:: html+jinja | ||
|
||
{# app/Resources/views/Emails/registration.html.twig #} | ||
<h3>You did it! You registered!</h3> | ||
|
||
{# example, assuming you have a route named "login" $} | ||
To login, go to: {{ url('login') }}. | ||
|
||
Thanks! | ||
|
||
{# Makes an absolute URL to the /images/logo.png file #} | ||
<img src="{{ absolute_url(asset('images/logo.png')) }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no PHP template? 😿 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this new function only exists for Twig: https://github.com/symfony/symfony/pull/13264/files If there's some solution for PHP, I certainly don't mind putting it in. All I know of is to hack something in by getting the domain off of the request object There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, indeed. I'll open an issue there (imo, 2.7 should still support PHP templating, no matter what will happen in 3.x) |
||
|
||
The ``$message`` object supports many more options, such as including attachments, | ||
adding HTML content, and much more. Fortunately, Swift Mailer covers the topic | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor comment: in the rest of this template we use HTML tags. Maybe we should replace
{{ url('login') }}
by<a href="{{ url('login') }}">...</a>
to create a real link?