Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[ NEW PLUGIN ] SendEmailAfterAdd v1

Quote Reply
[ NEW PLUGIN ] SendEmailAfterAdd v1
Hi,

Heres a freebie little plugin. Basically, it sends out an email to the person who just submitted a link (to Contact_Email). This is a feature missing in 2.x versions, but it *may* (or may not) have been added in 3.x (I havn't checked it out too much yet).

You can find the plugin attached to this post. The email template is add-email-pre.txt. All the configuration, link and user details are available here... as well as the values from $IN (the "form submission").

One last thing to say... enjoy <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hello Andy,

I test your script but, I have an error.

It does not seek the file add-email-pre.txt in the good folder.

A fatal error has occured:
GT::Template::Parser (14545): Unable to locate template file 'add-email-pre.txt' in ' ... /admin/templates/default' or any inheritance directories at GT::Template::_compile_template line 677.
Please enable debugging in setup for more details.


The file is in the folder : ' ... /admin/templates/myfiles' .

You have an idea ?

Thank you for your assistance.

Mick
Quote Reply
Re: [mick31] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

Quote:
The file is in the folder : ' ... /admin/templates/myfiles' .

Why do you have them there, and not in .../admin/templates/default/ ? They will need to be there, for it to work right Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hello Andy,

Thank you for your answer.

I use a personalized folder for build_default_tpl.

It is not possible to use a personalized folder ?

Mick
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hello Andy,

I found a solution.

I replaced this code :

my $message = GT::Template->parse( 'add-email-pre.txt', { %$newIN, %$USER, %$CFG }, { compress => 0 } );

with :

my $tpl_set = $IN->param('t') || $CFG->{build_default_tpl};
my $message = GT::Template->parse("add-email-pre.txt", { %$newIN, %$USER }, { compress => 0, root => $CFG->{admin_root_path} . "/templates/" . $tpl_set });



Your script works now with my folder by default (myfiles).


If you have one moment, you can check ?

Thank you for your assistance.

Mick
Quote Reply
Re: [mick31] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
I've noticed that a few plugins don't seem to place the templates in the right directory- I've been doing it manually.
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hello Andy,

I use your script. But, it poses a problem.

I have fields which the user is obliged to inform.

If the user does not supplement the fields correctly, an error message is turned over by Links SQL. Then the email is sent by script.

The user corrects the error, but it receives an email again.

It is possible to correct this problem ?

Thank you for your answer.

Mick
Quote Reply
Re: [mick31] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

Mmm.. so you're getting the email, even when someone fills the form in incorrectly, and gets an error? (i.e its not submitted).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi Andy,

Yes

An idea ?

Thank you

Mick
Quote Reply
Re: [mick31] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

In /admin/Plugins/SendEmailAfterAdd.pm, find;

Code:
my (@args) = @_;

..and change to;

Code:
my (@args) = @_;

my $results = shift;
return @args if $results->{error};

That should work =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Thank you Andy,

Your adaptation correctly seems to work.

Thank you for your assistance.

Mick
Quote Reply
Re: [mick31] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Great Cool

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

I've been made aware of a bug in this plugin. It was also emailing out people who were rejected, or not validated. The new version (2.0) can be downloaded from our site:

http://www.ultranerds.com/...dEmailAfterAdd_L150/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi Andy,

I have a problem with script V.2. I do not receive e-mail.

I modified the patch templates again, but I have the error message:
http://www.gossamer-threads.com/...?post=282578#p282578

GT::Plugins (29135): Error running plugin 'POST' hook 'Plugins::SendEmailAfterAdd::user_add_link': Global symbol "$newIN" requires explicit package name at SendEmailAfterAdd.pm line 53.

Is There a more recent version?

Would It be possible to use the function e-mail of GL?

Links::send_email('add-email-pre.eml'...

Thanks!

Mick
Quote Reply
Re: [MJ_] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

Please try this new version. I've also changed the email to add-email-pre.eml.

Untested, as I'm very busy atm - but if its all ok, lemme know and I will add it to the Download Area on the site :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi Andy,

Thanks, It is perfect! :)
&#12288;
Do You think that it would be possible to use a plugin similar for the review function?
I jointly use the option user_review_required on No with your plugin Captcha.
That functions correctly, but the adin does not receive a warning by email if a comment is added.
It would be very useful.

Thanks again!

Mick

Quote Reply
Re: [MJ_] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi,

Mmmm, I guess it could be done with the review system. Not sure if/when I'll have time to do that though (I don't really have much free time at the moment - I shouldn't really have even re-done this plugin this morning Wink)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] [ NEW PLUGIN ] SendEmailAfterAdd v1 In reply to
Hi Andy,

I understand, I will solicit you again.

Thank You for your great availability. :)

Mick