Danielss89
Repos
68
Followers
50
Following
23

Events

Soflomo Email issue with SlmQueue(SlmQueueBeanstalkd)

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,

Created at 2 months ago
Soflomo Email issue with SlmQueue(SlmQueueBeanstalkd)

Closing as stale

Created at 2 months ago
pull request closed
Update composer.json
Created at 2 months ago
Update composer.json

Not sure what this is supposed to do?

Created at 2 months ago
[Idea] Config option for "forwarding" of all emails to own email

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 ?

Created at 2 months ago
closed issue
Rsync fail

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)

Created at 2 months ago
HourCounter resets with high hour count

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?

Created at 2 months ago
reopened issue
HourCounter resets with high hour count

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?

Created at 2 months ago
HourCounter resets with high hour count

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?

Created at 2 months ago