Forums

JTEXT and emial to admin and subscribers

jimboyr 13 Mar, 2008
I have 1.5.1 and am trying the latest release for chronofirms.

Mu probem is that the emails sent to the registering person contain nothing but SEND_MSG_ACTIVATE and the admins get an empty message with SEND_MSG_ADMIN in it.

Line 245 of cf_joomla_registration.php is:
$message2 = sprintf ( JText::_( 'SEND_MSG_ADMIN' ), $row->name, $sitename, $name, $email, $username);

If this is followed by echo $message2 to debug the statement it produces:

SEND_MSG_ADMIN

and not the message

Any ideas? I checked the language files and SEND_MSG_ADMIN is defined.

James
GreyHead 14 Mar, 2008
Hi James,

Looking at this I don't think there should be quotes round the Define. Try JText::_( SEND_MSG_ADMIN ) and see if that does the trick.

Bob
d3vilr3d 29 May, 2008
Hi,

I am also experiencing problem with the msg sent. As described by the original poster, I get SEND_MSG_ADMIN instead of the whole message.

I tried to remove the ' ' and it did not help.

Any other suggestion?
GreyHead 29 May, 2008
Hi d3vilr3d,

There's a problem that the language file is not loaded until the user is logged in๐Ÿ˜Ÿ

My solution was to copy the defines I needed into my code box. Max suggested a more elegant solution

you can make a copy of the com_user language file in the languages folder and rename it to com_chronocontact too and this will solve it!

Bob
d3vilr3d 29 May, 2008
Ah I see!

Thanks for your quick replies.

I'll try that now.
wizdum 17 Jun, 2008
It seems both the constants not being defined and the syntax are wrong.
When I uncomment the constants i get:-

Notice: Use of undefined constant SEND_MSG_ACTIVATE - assumed 'SEND_MSG_ACTIVATE' in
on line 283

Notice: Use of undefined constant SEND_MSG_ADMIN - assumed 'SEND_MSG_ADMIN' in
on line 315

Notice: Use of undefined constant REG_COMPLETE_ACTIVATE - assumed 'REG_COMPLETE_ACTIVATE' in
on line 252


Shouldn't this be using the messages defined in Community Builder?
In fact, wouldn't it be best to have Community Builder handle the emailing? (no idea if this is possible, but it would be ideal)
GreyHead 17 Jun, 2008
Hi wizdum,

Please read message #8974 just above, it has two fixes for this.

Oh, and Joomla is doing the mailing.

Bob
wizdum 18 Jun, 2008
Hi GreyHead,

The constants used are not defined anywhere currently. I understand i can add them myself but my question is can the plugin use the messages already configured in Community Builder?
GreyHead 18 Jun, 2008
Hi wizdum,

Yes they are - in the com_user language file. The default version is language/en-GB/en-GB.com_user.ini

Bob
wizdum 19 Jun, 2008
I copied
language/en-GB.com_user.ini
language/en-GB.com_chronocontact.ini

and this got the emails working. However i still get the notices about the undefined constants and i had to define REG_COMPLETE_ACTIVATE myself.

The emails actually contain the content defined in Community Builder... not the strings foudn in en-GB.com_user.ini/en-GB.com_chronocontact.ini :blink:

Anyway. it seems to be working how i wanted it to.
thanks for the fix.
GreyHead 20 Jun, 2008
Hi wizdum,

Glad it's working for you. I think that you probably have to take the quotes from around the language defines to get them working so it has to be, for example:
JText::_( REG_COMPLETE_ACTIVATE )
and not
JText::_( 'REG_COMPLETE_ACTIVATE' )
Bob
wizdum 24 Jun, 2008
Yeah. I have done that. Otherwise i wouldnt be getting the "Use of undefined constant" error. It would just use the string.

Unfortunately I don't understand enough about joomla internals to understand what is going on but at least its working :unsure:

Im happy to help in debugging by providing files, output etc.
GreyHead 25 Jun, 2008
Hi wizdum,

Thanks, I think this is one for Max to follow up in future releases of the PlugIns.

Bob
This topic is locked and no more replies can be posted.