Forums

No validation but confirmation mail !

DJLN 16 Feb, 2009
Greetings Max and folks !


So, after a few tweaks and the buying of the license,
my ChronoComment is nearly perfect... There is just
one thing that lacked to make it fully perfect, and I
hope you will be able to help me there !

Is it possible to tweak the validation mail function
in order to transform it in a simple confirmation mail ?
i.e I want that the people who just post a comment
receive a confirmation mail that says "Hello, thanks
for the comment [and other marketing stuff :wink: ]",
but with no action requested : the comment should
appear as usual, no validation needed, but he soulg
still receive a confirmation mail.

I think that it could be done by using the already
existing function of the validation mail ? But how
could we disable the validation process and still
display a mail as a confirmation ?


I hope you will help me make my ChronoComment
totally perfect ! :wink:


Thanks in advance,
Dushan from Switzerland

P.S : as usual, please forgive my poor english
Max_admin 16 Feb, 2009
Hi Dushan,

this one must be done using a core hack, are you fine with this ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 17 Feb, 2009

Hi Dushan,

this one must be done using a core hack, are you fine with this ?

Regards,
Max



A "core hack" of what ? I'm afraid I'm not familiar with that term, sorry... What does that imply ?
GreyHead 17 Feb, 2009
Hi Dushan,

'Core hack' means editing the files that come with Joomla or with the ChronoForms extension.

It's not hard to do - but is generally discouraged as 'core hacks' are easily forgotten when you do upgrades; the hacked file is overwritten and something stops working. Or, if you have too many hacked files, upgrading becomes extremely difficult or impractical.

Having said that, I think that in this case it's probably OK - but make a note somewhere so that you remember if the hack stops working in the future.

Bob
DJLN 18 Feb, 2009
@ GreyHead : Oh, I see... Thanks a lot for the clear explanation !


Well, in that case, let's give a shot to the core hack ! :wink:
Max_admin 18 Feb, 2009
Hi Dushan,

in this file:
components/com_chronocomments/chronocomments.php

find:
// send verification email


add after it add:

$email_body = 'your comment was added';
JUtility::sendMail($configs->get('vemail_fromemail'), $configs->get('vemail_fromname'), $post['email'], $subject, $email_body, true, NULL, NULL, NULL, NULL, NULL );
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 19 Feb, 2009
@ Max :

Hi !

So i've done the hack and it works, thank you so
much. However, there is still three problems, that
I hope you can help me solve :

1) A confirmation pop-up appears when I post a
comment, that ask to check mail and confirm by
clicking on the link... It is of no use now that
there is no more confirmation requested, so how
can I get rid of that box ?



2) I receive the confirmation mail I wanted to
after commenting, but I also receive another
mail that just says "your comment was added"
which is of the use, as I say the same thing in
the first confirmation mail... How can I disable
that second mail ???



3) When posted, the comments did not appear
right away, I have to validate them, which I don't
want to have to. Is it possible instead to make
them appear automatically ?



Thanks a lot for your help Max !
Max_admin 19 Feb, 2009
Hi Dushan,

#1,2,3 - disable the verification email in the parameters area, disable it completely for all users!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 19 Feb, 2009

Hi Dushan,

#1,2,3 - disable the verification email in the parameters area, disable it completely for all users!

Regards
Max



It's done and it seems to be OK... But there is one other thing :

I have to edit the "your comment was added" fields, and when I do that (using HTML), the comment did not appear anymore (as if nothing happened). How can I customize the message and subjects fields so that it still work and with more possibilities (I need to use < br > and < a href > markup - or I-don't-know-the-name-of-that :wink: ). It may be useful to precise I have no clue of PHP langage...

Sorry for making you work so much... 😶
Max_admin 20 Feb, 2009
Hi Dushan,

your comment was added

is this the subject or the body ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 20 Feb, 2009

Hi Dushan,

your comment was added

is this the subject or the body ?

Cheers
Max



It's the body... There is nothing in the subject, and I'd like to add something also...

Thanks a lot,
Dushan
Max_admin 20 Feb, 2009
Well, in the code piece you added you have full control over everything in this extra email:

    $email_body = 'your comment was added';
    JUtility::sendMail($configs->get('vemail_fromemail'), $configs->get('vemail_fromname'), $post['email'], $subject, $email_body, true, NULL, NULL, NULL, NULL, NULL );


for example if you placed
$subject = "my subject";
then it will be used!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 20 Feb, 2009

Well, in the code piece you added you have full control over everything in this extra email:

    $email_body = 'your comment was added';
    JUtility::sendMail($configs->get('vemail_fromemail'), $configs->get('vemail_fromname'), $post['email'], $subject, $email_body, true, NULL, NULL, NULL, NULL, NULL );



Yes, but may I add HTML within the body text ? Because it's when I attended to modify it that the problem appeared... Is there some special rules there ? (I've used <br>, <a href> and <b> stuff...)
Max_admin 20 Feb, 2009
making it like this:
$email_body = 'your comment <br> was added';
should be fine!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 23 Feb, 2009
Well, it's still not working when I try to use a complex structure, nothing happens and the comment did not appear...

Here is a copy/paste of the modified code, maybe it would be helpful to figure out what's the problem...

// send verification email
$email_body = '<b>Bonjour {name},<br><br>Merci pour votre commentaire sur le Filtre-à-Miracle. Si vous ne l'avez pas déjà, j'aimerais vous offrir notre guide gratuit "Achetez Malin et Éviter les Arnaques sur Internet" pour vous remercier... Pour recevoir le guide, il vous suffit de vous inscrire à notre Newsletter en cliquant ici : <br><br><a href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">Newsletter du Filtre-à-Miracle</a> <br><br>Merci, et au plaisir de vous relire tout bientôt ! <br><br>Dushan JANCIK,<br>Administrateur du Filtre-à-Miracle';
JUtility::sendMail($configs->get('vemail_fromemail'), $configs->get('vemail_fromname'), $post['email'], $subject = "Votre commentaire sur le Filtre-à-Miracle";, $email_body, true, NULL, NULL, NULL, NULL, NULL );


Hope you can help me out here...

Thanks a lot in advance,
Dushan
GreyHead 23 Feb, 2009
Hi Dushan,

I can immediately see that there are un-escaped quotes in the email body that will break the PHP (see l'avez, j'aimerais).

Try this:
$email_body = 'Bonjour {name},<br><br>Merci pour votre commentaire sur le Filtre-&agrave;-Miracle. Si vous ne l’avez pas d&eacute;j&agrave;, j’aimerais vous offrir notre guide gratuit “Achetez Malin et &Eacute;viter les Arnaques sur Internet” pour vous remercier... Pour recevoir le guide, il vous suffit de vous inscrire &agrave; notre Newsletter en cliquant ici : <br /><br /><a href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">Newsletter du Filtre-&agrave;-Miracle</a><br /><br />Merci, et au plaisir de vous relire tout bient&ocirc;t ! <br /><br />Dushan JANCIK,<br />Administrateur du Filtre-&agrave;-Miracle';

Bob
DJLN 25 Feb, 2009
Thanks a lot Bob, I'll try this right away...

I really HAVE TO acquire notion of PHP, even if i'm not a programmer...

EDIT : Well, it still don't work... Is there another thing that break the code or so ?
GreyHead 25 Feb, 2009
Hi dushan,

Yes, it 's a good idea to know some PHP :-)

In this case you need to know that PHP identifes strings by looking at the opening and closing quotes " . . ." or ' . . . ' Once it finds an opening quote it searches for the next matching quote and treats that as a closing quote, and the end of the string unless the quote is escaped with a slash \" or \' when it is treated as a part of the string and the serach continues.

Bob
Max_admin 25 Feb, 2009
Hi Dushan,

try testing with a piece of your email HTML, then add one more..etc until you find where the problem is, for me it looks fine!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 28 Feb, 2009
So, here it is : I've finally managed to make something
decent here...

I was unable to add some special characters though ("à", "é")
The codes given by Bob weren't working, nor the standard
HTML code. However, it's not really important and I have
nearly the mail I wanted.

I've just a last nOobs question here : How can I insert the
name given by the commentator within the subject and
the body of the confirmation mail ?


I want something like :

Subject : "Thanks for your comment, {name of the commentator}"

Body : "Hello {name of the commentator}, blablabla




After that last tweak, it should be absolutly perfect !

All the best,
Dushan
Max_admin 28 Feb, 2009
Hi Dushan,

I think the special characters should work fine but try to replace them with the HTML entities!

for the tweak, use :
JRequest::getVar('name')


$Subject = "Thanks for your comment, ".JRequest::getVar('name');



Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 04 Mar, 2009

Hi Dushan,

I think the special characters should work fine but try to replace them with the HTML entities!

for the tweak, use :

JRequest::getVar('name')


$Subject = "Thanks for your comment, ".JRequest::getVar('name');



Regards,
Max



Hi Max

Regarding the special characters, they don't work neither if I use them simply not if I use HTML entities... Do you have any idea why ? (maybe it's linked to my Thunderbird setting...)

For the tweak, it doesn't work and I have the same problem than before (nothing appends when I submit the comment). There is probably a mistake somewhere it the way I have implemented your code in my custom mail...

Here is the concerned code, maybe it will help :

$email_body = '<br>Bonjour NAME,<br><br>Merci pour votre commentaire sur le <br>Filtre-a-Miracle... <br><br>Si vous ne l\'avez pas deja, j\'aimerais <br>vous offrir notre guide gratuit : \'Achetez <br>Malin Et Evitez Les Arnaques Sur Internet\' <br>pour vous remercier de votre participation.<br><br>Pour recevoir le guide, il vous suffit de <br>vous inscrire a notre Newsletter en <br>cliquant sur le lien ci-dessous :<br><br><a href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">www.filtre-a-miracle.com/s-inscrire-newsletter.html</a><br><br><br>Merci encore, et au plaisir de vous relire <br>tout bientot ! <br><br>Dushan JANCIK, <br>Administrateur du Filtre-a-Miracle<br><a href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">http://www.filtre-a-miracle.com</a>';
JUtility::sendMail($configs->get('vemail_fromemail'), $configs->get('vemail_fromname'), $post['email'], $Subject = "Au sujet de votre commentaire, NAME", $email_body, true, NULL, NULL, NULL, NULL, NULL );


The two "NAME" in the body and in the subject are the places where I want to display the name... I've tryed different variation, but nothing seems to work...

All the best,
Dushan
Max_admin 04 Mar, 2009
Hi Dushan,

For the special characters, please try a gmail address, for the name, try $post['name'] ?

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 05 Mar, 2009

Hi Dushan,

For the special characters, please try a gmail address, for the name, try $post['name'] ?

Cheers
Max



Ok, I'll try on gmail...

Regarding the "$post['name']", it's still not working... Another idea ?

Please tell me the exact way how to add it in my text : I may be making a mistake of form (forgetting a comma, or something like that)

Thanks a lot, and sorry for being so dumb with PHP ! 😶

All the best,
Dushan
Max_admin 05 Mar, 2009
Hi Dushan,

No problems, sometimes you just face strange errors but they are simple things, I can't tell whats the problem without testing the code myself and seeing the results, but the easiest way is to use this:

$email_body = 'some text'.$post['name'];


Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 06 Mar, 2009
Hi Max !

Thanks a lot, now it's working on the subject...

But it's still not working on the body, I think it's because there is not only text before the name tag, but also after...

Here is the entire body code, can you tell me how I should put the code to replace "NAME" by the actual name ?

$email_body = '<br>Bonjour NAME,<br><br>Merci pour votre commentaire sur le <br>Filtre-a-Miracle... <br><br>Si vous 
ne l\'avez pas deja, j\'aimerais <br>vous offrir notre guide gratuit : \'Achetez <br>Malin Et Evitez Les Arnaques 
Sur Internet\' <br>pour vous remercier de votre participation.<br><br>Pour recevoir le guide, il vous suffit de 
<br>vous inscrire a notre Newsletter en <br>cliquant sur le lien ci-dessous :<br><br><a 
href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">www.filtre-a-miracle.com/s-inscrire-news
letter.html</a><br><br><br>Merci encore, et au plaisir de vous relire <br>tout bientot ! <br><br>Dushan JANCIK, 
<br>Administrateur du Filtre-a-Miracle<br><a 
href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">http://www.filtre-a-miracle.com</a>';


All the best,
Dushan
Max_admin 06 Mar, 2009
Hi Dushan,

the text before OR after the $post['name'] must be inside 2 ' quotes and you must attach the variable to the 2 strings using a ( . ) /period!!

Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
DJLN 07 Mar, 2009
So if I understand you well, it should be something like this : (the mods are in red)

$email_body = '<br>Bonjour' $post['name']',<br><br>Merci pour votre commentaire sur le <br>Filtre-a-Miracle... <br><br>Si vous
ne l\'avez pas deja, j\'aimerais <br>vous offrir notre guide gratuit : \'Achetez <br>Malin Et Evitez Les Arnaques
Sur Internet\' <br>pour vous remercier de votre participation.<br><br>Pour recevoir le guide, il vous suffit de
<br>vous inscrire a notre Newsletter en <br>cliquant sur le lien ci-dessous :<br><br><a
href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">www.filtre-a-miracle.com/s-inscrire-news
letter.html</a><br><br><br>Merci encore, et au plaisir de vous relire <br>tout bientot ! <br><br>Dushan JANCIK,
<br>Administrateur du Filtre-a-Miracle<br><a
href="http://www.filtre-a-miracle.com/index.php/s-inscrire-newsletter.html">http://www.filtre-a-miracle.com</a>'';



and you must attach the variable to the 2 strings using a ( . ) /period!!



I don't understand, may you give me an exemple please ? It would be really helpfull I think

Thanks a lot,
Dushan
GreyHead 07 Mar, 2009
Hi Dushan,

As Max said you must put the variable in using correct PHP syntax and use the joining dots:
$email_body = '<br>Bonjour '.$post['name'].',<br /><br />Merci pour votre . . .


Bob
DJLN 09 Mar, 2009
Ok, this time I get it and it's WORKING !!! 😀

Thanks a lot Max and Bob !

May I repeat myself : Please send me a PM with your postal adresses, I HAVE TO send you a little something from Switzerland for all your help ! :wink:
Max_admin 09 Mar, 2009
No problems, Thanks!! 😀

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.