Hi Jurian,
I have been working on integrating Soflomo Mail with SlmQueue(SlmQueueBeanstalkd) and I am getting issue when executing it via the Console using the Worker system (Beanstalkd).
To explain in detail, I have created a ReferralEmailJobFactory which has the following code - $sm = $serviceLocator->getServiceLocator(); $emailService = $sm->get('EmailService'); return new ReferralEmailJob($emailService);
This is the ReferralEmailJob file - protected $emailService;
public function __construct($emailService) { $this->emailService = $emailService; }
public function execute()
{
$payload = $this->getContent();
$manager_emails = $payload['manager_emails'];
$payor = $payload['payor'];
$patient = $payload['patient'];
$status = $payload['status'];
$id = $payload['id'];
$mailService = new EmailService($this->emailService);
$mailService->sendEmail($manager_emails, $payor, $patient, $status, $id);
}
I have attached the EmailService.php file which has its EmailServiceFactory(attached as well) to get the instance of the Soflomo\Mail\Service\MailService to send the email.
When the job is ready in Beanstalkd and I run the worker command to execute the job from the console ( I use Ubuntu) - php public/index.php queue beanstalkd default, I get an error due to the renderer inside Soflomo Mail being ViewRenderer which is not supported in Console Execution.
So I then changed the MailServiceFactory inside Soflomo Mail to have this line - $renderer = $serviceLocator->has('ViewRenderer') ? $serviceLocator->get('Soflomo\Mail\Renderer') : new PhpRenderer(); to see if it works and this time, the execution proceeds ahead but I then get this error - exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "referral/new-referral-email"; resolver could not resolve to a file' in /var/www/SeniorCareMarketing/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:493
The template file is in the correct location and when I have used Soflomo Mail independently via HTTP request, the mail is sent correctly.
I tried adding a Resolver class to the PHPRenderer inside the renderBody method of the MailService class of Soflomo Mail and this helped in overcoming this issue -
$resolver = new TemplateMapResolver(); $resolver->setMap(array('referral/new-referral-email' => '/var/www/SeniorCareMarketing/module/Application/view/application/referral/new-referral-email.phtml')); $this->getRenderer()->setResolver($resolver); $html = $this->getRenderer()->render($options['template'], $variables);
But I request a proper solution to this integration issue instead of the hack that I have done. Please advise. I have been looking at this issue for the past 3 days,
Closing as stale
Not sure what this is supposed to do?
I'm not sure this is in scope of Soflomo\Mail, but i think it's a cool feature which could be added to config. Basicly the idea comes from sendmail, where you can put in an email which will receive EVERY email sent out. So all emails going out to customers(or whatever else) is also being sent to this specified email, not as bc or cc, but as a duplicate. I've moved to MailGun and this is actually a feature i miss.
WDYT @juriansluiman ?
On the first docker-compose up, with presync = 1, i'm getting the following error:
rsync: failed to set permissions on "/vol/container/node_modules/webpack-dev-middleware/node_modules/.bin/mime": Not supported (95)
I want to add an hour counter to my website, starting from a date. Using the "counter-from-new-years" example, i changed it to use HourCounter face, instead of DayCounter. When the clock loads, it show the correct amount of hours "4000" and something, but at the first flip, it resets to 00:00:00 and starts counting up from this reset. Is this a bug, or am i missing a setting?
I want to add an hour counter to my website, starting from a date. Using the "counter-from-new-years" example, i changed it to use HourCounter face, instead of DayCounter. When the clock loads, it show the correct amount of hours "4000" and something, but at the first flip, it resets to 00:00:00 and starts counting up from this reset. Is this a bug, or am i missing a setting?
I want to add an hour counter to my website, starting from a date. Using the "counter-from-new-years" example, i changed it to use HourCounter face, instead of DayCounter. When the clock loads, it show the correct amount of hours "4000" and something, but at the first flip, it resets to 00:00:00 and starts counting up from this reset. Is this a bug, or am i missing a setting?