## The contents of this file are subject to the Common Public Attribution
## License Version 1.0. (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
## License Version 1.1, but Sections 14 and 15 have been added to cover use of
## software over a computer network and provide for limited attribution for the
## Original Developer. In addition, Exhibit A has been modified to be
## consistent with Exhibit B.
##
## Software distributed under the License is distributed on an "AS IS" basis,
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
## the specific language governing rights and limitations under the License.
##
## The Original Code is reddit.
##
## The Original Developer is the Initial Developer.  The Initial Developer of
## the Original Code is reddit Inc.
##
## All portions of the code written by reddit are Copyright (c) 2006-2013
## reddit Inc. All Rights Reserved.
###############################################################################

<%!
    from datetime import datetime, timedelta
    from r2.models import Email
    from r2.lib import promote
    from r2.lib.template_helpers import get_domain
 %>
<%
    edit_url =  promote.promo_edit_url(thing.link)
 %>

%if thing.kind == Email.Kind.NEW_PROMO:
This email is to confirm reddit.com's receipt of your submitted self-serve ad.  At the moment you have no campaigns associated with this link.  To set up a campaign and payment if you haven't already, please visit the link's edit page:

   ${edit_url}

Please note that we can't approve your ad until you have set up payment, and that your ad must be approved before it goes live on your selected dates.

Your credit card will not be charged until 24 hours prior to your ad going live on reddit.

If your ad is rejected your credit card will not be charged.  Don't take it personally if it happens, it's because of these guidelines:

http://www.reddit.com/help/selfservicepromotion

%elif thing.kind == Email.Kind.BID_PROMO:
This email is to confirm that your bid of $${"%.2f" % thing.bid} for a self-serve ad on reddit.com has been accepted.  The credit card number you provided will be charged 24 hours prior to the date your self-serve ad is set to run. 

Having second thoughts about your bid? Want to be sure you're outbidding the competition?  You'll have until ${(thing.start_date - timedelta(1)).strftime("%Y-%m-%d")} to change your bid here:

   ${edit_url}
%elif thing.kind == Email.Kind.ACCEPT_PROMO:
This email is to confirm that your self-serve reddit.com ad has been approved by reddit!  The credit card you provided will not be charged until 24 hours prior to the date you have set your ad to run.  If you make any changes to your ad, they will have to be re-approved.  

It won't be long now until your ad is being displayed to hundreds of thousands of the Internet's finest surfers.

%elif thing.kind == Email.Kind.REJECT_PROMO:
This email is to inform you that the self-serve ad you submitted to reddit.com has been rejected.  :( Please view the included explanation, and consult reddit's Terms of Service for information on conditions for approval.  If you have any questions please reply to this email.

%if thing.body:
Your promotion has been rejected for the following reason:
   ${thing.body}
%endif:

To update your promotion please go to:
   ${edit_url}
and we'll reconsider it for sumbission.
%elif thing.kind == Email.Kind.QUEUED_PROMO:
This email is to inform you that your self-serve ad on reddit.com is about to go live.  Feel free to reply to this email if you have any questions.

%if thing.trans_id > 0:
 Your credit card has been successfully charged by reddit for the amount you bid.  Please use this email as your receipt.


================================================================================
TRANSACTION #${thing.trans_id}  
DATE: ${datetime.now(g.tz).strftime("%Y-%m-%d")}
................................................................................

AMOUNT CHARGED: $${"%.2f" % thing.bid}
SPONSORSHIP PERMALINK: ${thing.link.make_permalink_slow(force_domain = True)}

================================================================================
%else:
Your promotion was a freebie in the amount of $${"%.2f" % thing.bid}.  
%endif
%elif thing.kind == Email.Kind.LIVE_PROMO:
This email is to inform you that your self-serve ad on reddit.com is now live and can be found at the following link:

  ${thing.link.make_permalink_slow(force_domain = True)}

Thank you for your business!  You can track your promotion's traffic here:

  ${promote.promo_traffic_url(thing.link)}

Note that there is a 2 hour delay on tracking so at first you make not see any data, and completed traffic will be 2-3 hours behind.
 
Remember to log in to reddit.com using the username and password you used when you bought this self-serve ad.  Please let us know if you have any questions.
%elif thing.kind == Email.Kind.FINISHED_PROMO:
This email is to inform you that your self-serve ad on reddit.com has concluded.  Please visit the following link for traffic results for your ad, and note that complete results will not appear until 24 hours after receipt of this email.

  ${promote.promo_traffic_url(thing.link)}

Remember to log in to reddit.com using the username and password you used when you bought this self-serve ad.

Thank you again for advertising on reddit, we hope you'll come back and do business with us again.  We'd love to know how your experience with reddit's self-serve ad was, feel free to reply to this email to let us know.   We've also set up a community just for self-serve advertisers like yourself:

  http://www.reddit.com/r/selfserve

We're hoping to create a place for you to exchange tips and tricks for getting the most out of your sponsored links, as well as to provide support for new users.
%endif

Thank you,

The reddit team
selfservicepromotion@reddit.com

_____
http://www.reddit.com/help/selfservicepromotion
