Generating an email with 'my favourite pics' Generating an email with 'my favourite pics'
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Generating an email with 'my favourite pics'

Started by stock, September 24, 2005, 12:49:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stock

Is there a mod that will generate an email from the person who has put some picture in their folder, as well as downloading the zip, to ask me about the pictures? I have called it 'My Lightbox' not My Favourites (www.stockshoots.co.uk, probably offline).

Stock

Joachim Müller

edit zipdownload.php, findinclude ( 'include/archive.php');and add after it (in a new line)require('include/mailer.inc.php');
Find$zip->filedownload('pictures.zip');and add after it (in a new line)$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
$sender_email = $USER_DATA['user_email'];
$message = $sender_name . '('.$sender_email.') has downloaded these files:\n\r';
foreach ($filelist as $key => $value) {
    $message .= $value.'\n\r';
}
$result = cpg_mail($CONFIG['gallery_admin_email'], 'Lightbox download from'.$sender_name, $message, 'text/html', $sender_name, $sender_email);
Haven't tested this, I'm coding from the top of my head. Please report if this works.

stock

Gau gau,

Thanks very much! I've tried this but nothing. However, I wonder if I should be adding an email address anywhere, such as in mailer.inc.php?

Stock


Joachim Müller

for testing purposes, use this bit of code://$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
//$sender_email = $USER_DATA['user_email'];
//$message = $sender_name . '('.$sender_email.') has downloaded these files:\n\r';
//foreach ($filelist as $key => $value) {
//    $message .= $value.'\n\r';
//}
$result = cpg_mail('you@yourdomain.tld', 'Lightbox download test', 'just a test', 'text/html', 'your name', 'you@yourdomain.tld'l);
print $result;
die();
- only change you@yourdomain.tld to your actual email address

stock

Okay, I have put in:
/**new code from here**/
$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
$sender_email = $USER_DATA['user_email'];
$message = $sender_name . '('.$sender_email.') has downloaded these files:\n\r';
foreach ($filelist as $key => $value) {
  $message .= $value.'\n\r';
}
$result = cpg_mail('admin@stockshoots.co.uk', 'Lightbox download test', 'just a test', 'text/html', 'your name', 'admin@stockshoots.co.uk'l);
print $result;
die();
/**new code above here **/

and get a parse error at line 78  - that is:
line with just } on before &result.


thanks for your continued help.

Stock
I can't see what's missing

Joachim Müller

do as I suggested and comment out the above part. If you don't, try this:$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
$sender_email = $USER_DATA['user_email'];
$message = $sender_name . '('.$sender_email.") has downloaded these files:\n\r";
foreach ($filelist as $key => $value) {
    $message .= $value."\n\r";
}
$result = cpg_mail($CONFIG['gallery_admin_email'], 'Lightbox download from'.$sender_name, $message, 'text/html', $sender_name, $sender_email);

stock

Gau gau, sorry I got it wrong before. However, fraid that doesn't work and now I have tried your next bit, all it does is download the zip file as normal, nor sign of sending email. Here is the text I have just in case:

Stock


$zip->filedownload('pictures.zip');

/**new code from here **/
$sender_name = get_post_var('sender_name', USER_NAME ? USER_NAME : (isset($USER['name']) ? $USER['name'] : ''));
$sender_email = $USER_DATA['user_email'];
$message = $sender_name . '('.$sender_email.") has downloaded these files:\n\r";
foreach ($filelist as $key => $value) {
    $message .= $value."\n\r";
}
$result = cpg_mail($CONFIG['gallery_admin_email'], 'Lightbox download from'.$sender_name, $message, 'text/html', $sender_name, $sender_email);
/**new code above here **/}
?>

Tranz

Does email work from your gallery? Can you send ecards, for example?

stock

Thanks, Yes it does. I had taken this facility off. However, while it doesn't quite do what I want, I did wonder looking at this, is it possible to have all pics from lightbox sent via ecard. Note ecard does not put in the admin address automatically and I need to use this for professional enquiries, not so people can send each other pretty images, if you see what I mean. I hope that makes sense. I do like the way it slots the image into an email in the way I wanted (though perhaps without the stamp image but I am sure I can work that one out).

I wondered, since the ecard coding contains some of what this would need it might be adapable? It would be a case of sending the images from the favourites to the ecard, adapted to incorporate as many images as needed. Then this and its images could be send in the email used by ecard.

I'd also like to have an email address already typed in in the ecard box.

I know this is all possible and realise it's away from coppermine normal but if you have any idea I'd be grateful.

Thanks both for all your help and any suggestions.

Stock

Tranz

I'm not sure exactly what you are trying to do. I understand the part about writing to you about a picture but not about the zipped stuff.

It could be possible to modify ecard to have the user send the mail to you. In 1.4, there is a report to admin function that is based on ecard code.

stock

TranzDance,

Yes, I am looking into that at the moment. I wanted to change the TO: box to say:
To: info at stockshoots or something, then I could put a link straight to the right email. But I need the 'submit' (ie, send the ecard) straight to that email address. Could you point me to the bit that I could make that work?

Thanks very much

Stock

Tranz

You can download v1.4 and check out report_file.php. You would also need to go through include/themes.inc.php (search for 'report').

artistsinhawaii

Stock,

This might be going off in a tangent a bit, but what it really sounds like to me is that you need a client-side shopping cart that doesn't post the typical price and shipping costs, but just lists selected items and details with a submit button that sends the entire form to you.  Creating a clone of the "ecard" button as TranzNDance suggested and linking it to a stripped and renamed ecard.php file would be a start.  You could then use this file to build a client-side inquiry cart. (note however, a client-side cart might be limited to less than 20 items at a time as all information must be stored in a cookie on the client's machine.)

Unfortunately, I'm not adept at coding so I can't help you any further, but I wanted to share my thoughts with you on this alternative approach.

A google search on the internet for "free client-side shopping cart" produces a number of listings which may interest you.

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

stock

thanks Dennis, I will look into that.

I have got the ecard looking a bit more like I want but it doesn't now send me emails and I really would like a link that gives you th choice, either
1) download zip files

and

2) send to stockshoots as an ecard

Then they have the choice of both. So right now I just need to work out

1) how to get the ecard sent to me
2) how to get the sit to add images from 'My favourites' to the ecard box
3) designing the ecard box to take more than one image.


But as you say, I will look into a readymade lighbox. I know ecommerce has one so maybe this would be handy.

Thanks

Lindsey
Stock

Tranz

ohhh... I didn't realize lightbox was a photo shopping cart. Are you aware of the paypal cart that Casper developed for coppermine?

stock

Sorry to confuse you. LIghtbox normally isn't a shopping cart but I think you could adapt a cart to act as a lightbox as long as it shows the images.

cheers

lindsey

stock

but I would like to see casper's card. Is this available for download?

L
Stock

artistsinhawaii

TranzNDance,

Unfortunately, Casper's mod links directly to paypal and is not a client-based shopping cart.  

Stock,

What it sounds like to me is that you want to put a link on your Favorites (Lightbox) page that does what IE's FILE+SEND+Page By Email option does.  The difference being that you want to hardcode the addressee's email address as yours.  Here's a link that you might find interesting: http://www.godandscience.org/general/mailpage.html

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

stock

Dennis,

You are right! I've just noted that re paypal. The other thing about them also is I have heard it said by a web designer I know that he hates when the only option you have is to pay by paypal and I agree with him as I think they completely overcharge and are becoming an automony. Aren't they also part of ebay? So it's more money in ebay's pocket. But design wise you are right as you go to their page from the basket.

Thatnks for the final bit that might be the way forward. I suppost to give the option of send ecard to downloap as zip file all I have to do is add a line in the top bar of the lightbox to give an option of sending as an ecard. the problem is the code that puts those images into the ecard.

It might be that using a readymade cart is the solution to that rather than me trying to work out the code. (I'm not a programmer so it's a miracle each time I get success with my mods!)

I'll keep you posted!

Lindsey

artistsinhawaii

Lindsey,

I'm working out the kinks on my client-based paypal mod for coppermine.  Hopefully, I will have it out in a week or two.

But do check out that link I posted above to send the entire HTML page of your "lightbox" as an email.   This would include all of the thumbnail images in the page the same way IE does it.
The drawback I see with this, however, is if the images are spread out over different pages/tabs.  (it the sender has more images than will fit in one page).

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.