Log message #4209783

# At Username Text
# Oct 21st 2019, 13:15 ndm @scuadra `Time::i18nFormat()` is not a static call, but how you usually document methods of a class. `$application['payment_date']->i18nFormat(\IntlDateFormatter::SHORT)`
# Oct 21st 2019, 13:12 jotpe Is it anyhow possible to set Flash Messages from another Helper?
# Oct 21st 2019, 13:09 scuadra And also I have one more question: can I use viewBuilder()->setTemplate() to set a template from a Plugin?
# Oct 21st 2019, 13:06 scuadra @admad I tried _Time::i18nFormat($application['payment_date'])_ but got error "Using $this when not in object context"
# Oct 21st 2019, 13:03 kevin.pfeifer thx to @challgren and @admad I got my Custom Mailer Class working now :D
# Oct 21st 2019, 12:31 admad @scuadra `Time::i18nFormat()`
# Oct 21st 2019, 12:19 kevin.pfeifer @admad ok, thx for the info. I will look into this "MailerAwareTrait" structure.
# Oct 21st 2019, 12:18 scuadra Hello. In Cake 3.x how can I format my a date field in Controller with TimeHelper i18nformat() or something similar?
# Oct 21st 2019, 12:18 admad you should never need more than a single class to `getMailer()` in your controller / command / model to send a mail
# Oct 21st 2019, 12:16 admad and then your controllers would use MailerAwareTrait which would allow you to use those mailer classes
# Oct 21st 2019, 12:15 admad @kevin.pfeifer there's no need for a custom mailing component. Use mailer classes
# Oct 21st 2019, 12:12 alexdd55976 i just started with authentication against AD to make my point in choosing the framework... even the version i used worked fine
# Oct 21st 2019, 12:11 kevin.pfeifer ah ok^^
# Oct 21st 2019, 12:11 alexdd55976 the project will take more then a year or longer, so we can start with a beta version without any problems
# Oct 21st 2019, 12:11 kevin.pfeifer but as I can tell right now everything works just as you would imagine it (if your base was on CakePHP 3)
# Oct 21st 2019, 12:10 alexdd55976 no pressure :)
# Oct 21st 2019, 12:10 alexdd55976 @admad said so :)
# Oct 21st 2019, 12:10 alexdd55976 so i will take those infos as well
# Oct 21st 2019, 12:10 kevin.pfeifer well i hope CakePHP 4 is released till then ^^
# Oct 21st 2019, 12:09 alexdd55976 :)
# Oct 21st 2019, 12:09 alexdd55976 i will face that in a couple of month
# Oct 21st 2019, 12:09 kevin.pfeifer which is not the case
# Oct 21st 2019, 12:09 kevin.pfeifer but in there i thought i can just use the Mailer Class exactly like the old Email Class
# Oct 21st 2019, 12:09 alexdd55976 @kevin.pfeifer you are right.. i did not check the class i used.. just copy pasted :)
# Oct 21st 2019, 12:08 kevin.pfeifer i have created a Mailing Component which is called by all my controllers
# Oct 21st 2019, 12:08 challgren I prefer the mailer route because that logic is all contained in a single class instead of littered in models/controllers
# Oct 21st 2019, 12:08 kevin.pfeifer @alexdd55976 you are using the Cake\Mailer\Email Class which will be deprecated on CakePHP 5.0 Since im refactoring my current application in CakePHP 4.0 im trying not to implement new stuff with soon to be depreacted functions
# Oct 21st 2019, 12:07 kevin.pfeifer @challgren thx for that, i will look into that. It is definitely a good idea to extend the default Mailer class and work with that.
# Oct 21st 2019, 12:05 slackebot1 $email->setViewVars($data['vars']); $email->setTransport('default'); return $email->send(); } ```
# Oct 21st 2019, 12:05 slackebot1 'company_id' => $query['company_id'], 'hash' => $confirm_hash, 'date' => date('d.m.Y'), 'time' => date('H:i') ] ]; if ($this->sendEmail($data)) { return true; } } return false; } public function sendEmail($data) { $email = new Email(); $email->setSubject($data['subject']); $email->setTo($data['email']); $email->setFrom('bla@foo.bar); $email->setReplyTo('bla@foo.bar'); $email->setTemplate($data['template']);
# Oct 21st 2019, 12:05 alexdd55976 @kevin.pfeifer or the easy version ```public function sendOptinMailToUser($query, $confirm_hash) { if (isset($query['data']->email) andand isset($query['mail_optin']) andand $query['mail_optin'] == true) { $data = [ 'subject' => 'Regsitriation', 'email' => trim($query['data']->email), 'template' => 'app_confirmation_blank', 'vars' => [ 'email' => trim($query['data']->email), 'access_key' => $query['access_key'],
# Oct 21st 2019, 12:02 challgren @kevin.pfeifer here’s my example
# Oct 21st 2019, 11:50 kevin.pfeifer since Cake\Mailer\Email will be deprecated in 5.0 i dont want to implement something that will be deprecated on the next Cake Version
# Oct 21st 2019, 11:49 kevin.pfeifer does someone have a working example for sending custom Emails with Cake\Mailer\Mailer and viewVars?
# Oct 21st 2019, 10:50 jotpe Found that on github: https://github.com/cakephp/phinx/issues/1431
# Oct 21st 2019, 10:49 jotpe Thanks. What also worked was `MysqlAdapter::PHINX_TYPE_STRING`
# Oct 21st 2019, 10:42 challgren add a length/limit for the varchar(*)
# Oct 21st 2019, 10:41 challgren string from what I’ve seen
# Oct 21st 2019, 10:39 jotpe For phinx migrations, what is the correct type of a `varchar` for `mysql`? `String`? http://docs.phinx.org/en/latest/migrations.html#id2
# Oct 21st 2019, 08:59 challgren Evening all!
# Oct 21st 2019, 08:54 slackebot1 !gist