You've got a good knack for delving deep enough into periphery topics that crop up to explain them, without either glossing over them or getting completely sidetracked. Love your work so far mate, has helped give me the nudge I needed to try and learn docker. Easy to follow, and you don't skip over things. Keep it up mate, will likely tune in for everything you release.
@GaryClarkeTech4 жыл бұрын
Cheers Emlyn, I appreciate your support and good luck with Docker...it's a pretty big subject but just learn as much as you're likely to use because you just end up forgetting the rest anyway...like I have!
@vhur88362 жыл бұрын
Gary To many known a random guy found on yt but to me he taught me how to use smfony i love Gary Thankl u Gary
@GaryClarkeTech2 жыл бұрын
Welcome!
@ramo0120324 жыл бұрын
Very nice tuto, great content, keep up the great work 💪💪💪
@GaryClarkeTech4 жыл бұрын
Thank you ramo..I appreciate it. Plenty more to come!
@Trixxro3 жыл бұрын
Awesome tutorial! What editor are you using?
@GaryClarkeTech3 жыл бұрын
Thanks..I appreciate it! Using PHPStorm with the Symfony Support plugin enabled.
@Trixxro3 жыл бұрын
Ty 👏
@thijsdew19882 жыл бұрын
Hi Gary, thank you for the content. Would these settings work on a production env as well? Or do i have to change some settings if i'm going on a live server?
@GaryClarkeTech2 жыл бұрын
Yes..you'd need to set it up for whichever 3rd party transport you use... symfony.com/doc/current/mailer.html#using-a-3rd-party-transport
@cprn.3 жыл бұрын
Do you happen to know how to make `Email` properly build the message with some attachments inlined via `cid` in HTML content (in `related` part of the body) and some as actual attachments (in `mixed` part)? I can't seem to find an example other than working with raw `Message` object and everything I tried so far builds a message with either attached files or inline images but not both.
@GaryClarkeTech3 жыл бұрын
Hmm..good question. I'll investigate.
@cprn.3 жыл бұрын
@@GaryClarkeTech I kind of figured it out. Kind of. Don't know if KZbin comment will show code correctly but here it goes, typed on a phone: $email->html(""); # lands in `related` $email->embed($file['content'], $file['name'], $file['mimeType']); # lands in `related` $email->attach($file2['content'], $file2['name'], $file2['mimeType']); # lands in `mixed` File names have to be unique. It doesn't work in CSS, e.g. `background-image: url(cid:{$file['name']})`, and even if it would, Thunderbird doesn't render it - there's a 15 years old bug still active. It still doesn't work in Thunderbird sometimes. Don't know why yet. The reason I even asked is because I had attachment as `DataPart` like so: $embedded = new DataPart($file['content'], $file['name'], $file['mimeType']); $embedded->setInline(); $email->attachPart($embedded, $embedded->getContentId()); In this case `$file` Lands in `mixed` with disposition `inline` - it works in e.g. Gmail but Thunderbird requires it to be in `related` alongside `$html` to render properly as embedded image.
@GaryClarkeTech3 жыл бұрын
@@cprn. Impressive that you did that on a phone! 🙌
@anas16343 жыл бұрын
what about .env file? what is the value of MAILER_DSN?
@GaryClarkeTech3 жыл бұрын
That comes from docker-compose in this scenario, not the .env file Here's an explanation: symfony.com/doc/current/setup/symfony_server.html#docker-integration
@ApoRekt2 жыл бұрын
does this work for symfony 6?
@ApoRekt2 жыл бұрын
nope
@garetts81562 жыл бұрын
@@ApoRekt just finished, everything works on Symfony 6 and PHP 8.1
@parijke3 жыл бұрын
Gary, if I want something to be templated in the database to assist for multiple languages, how would you approach that? i.e. I want to have this in a text field in my MailTemplate enity, something like: Dear {{user.Fullname }} Here's your invoice number {{invoice.number}} and render it using the TemplatedEmail() function...
@GaryClarkeTech3 жыл бұрын
Hey Paul...it's not something I've tried but I'd probably avoid putting it in the DB, keep everything in email template files and use the Symfony translation service. I'll have a look at the translator in a future recording cos I'd like to get more familiar with it...I can try to recreate what you describe.
@parijke3 жыл бұрын
@@GaryClarkeTech thanks Gary. But in this case, the users can create email templates themselves. I.e. this is a boking system, so the owner of a property can create an email template as a welcome message. I don't see how to do that without creating the templates in the database?
@GaryClarkeTech3 жыл бұрын
@@parijke Ah right...I get you now. If they are all gonna be allowed to create something completely custom, then you can store the body as text in the DB and have placeholders which can be parsed and replaced with values such as names etc using string replace functions. Maybe do the find and replace first before passing it into a template as a $body variable. In fact, if you're using entities, you could build it into the email body getter function. Show me what you come up with and we can figure something out.
@parijke3 жыл бұрын
@@GaryClarkeTech ❤
@parijke3 жыл бұрын
Got it working it was even easier that I thought. I share a raw version, maybe you've got some ideas to improve if you have the time and are in to it