Jump to content

Create Client - Always Sends Welcome Email


Recommended Posts

Posted

Hi,

 

I have been getting Blesta 3.0.4 setup, so far it's very nice (I'm a PHP Developer myself).

 

I have run into a bug in which even if I leave the checkbox for "Send Account Registration Email" unchecked, the email is still sent.

 

Investigating this a bit further, it's a simple coding if statement mistake and was super easy to fix too.

 

File: app/models/clients.php

Function: create($vars)

Line: 131

 

The if statement is as follows:

 

 

if (!isset($vars['send_registration_email']) || $vars['send_registration_email'] == "true") {

 

 

The issue is that if the variable isnt set it pases that if statement, and standard browser behavour doesn't send un-checked items, so thats the bug, a simple fix up as follows works perfectly:

 

 

if (isset($vars['send_registration_email']) && $vars['send_registration_email'] == "true" ) {

 

 

Hope this helps, not too big of a deal, but needs to be fixed ;).

 

Thanks

-Jason

 

 

 

Posted

Looks like the issue is with the controller that invokes that method, as the documented behavior of the Clients::create() method is to always send the welcome email unless 'send_registration_email' is explicitly != "true".

Guest
This topic is now closed to further replies.
×
×
  • Create New...