Skip to content

Commit

Permalink
Merge 7e12ffe into 2a51ddc
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonc86 committed Feb 16, 2018
2 parents 2a51ddc + 7e12ffe commit 97ecb4d
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ required environment variables at run time. Example content:
SECRET_KEY="ThisIsASecretKey"
DEFAULT_HOST="https://website.domain/"
EMAIL_HOST="emailhost"
EMAIL_FROM="noreply@email.address"
EMAIL_FROM="system@email.address"
PARENT_HOST="website.domain"
HOST_PORT=""
ALLOWED_HOSTS=[u'website.domain']
Expand Down
5 changes: 0 additions & 5 deletions ledger/accounts/templates/email/email_confirm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ If you did not approve this action, please disregard this message.
Best regards,

Parks and Wildlife Customer Portal



Please do not reply directly to this email. Should you need to contact the licensing section of the Department of
Parks and Wildlife, please send emails to wildlifelicensing@dpaw.wa.gov.au or call (08) 9219 9000.
5 changes: 0 additions & 5 deletions ledger/accounts/templates/email/login.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ Click this link to sign in: {{ login_url }}
Best regards,

Parks and Wildlife Customer Portal



Please do not reply directly to this email. Should you need to contact the licensing section of the Department of
Parks and Wildlife, please send emails to wildlifelicensing@dpaw.wa.gov.au or call (08) 9219 9000.
4 changes: 2 additions & 2 deletions ledger/payments/bpay/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def sendSummaryEmail(summary):
email = EmailMessage(
'BPAY Summary {}'.format(dt),
'BPAY Summary File for {}'.format(dt),
settings.DEFAULT_FROM_EMAIL,
settings.EMAIL_FROM,
to=[r.email for r in recipients]if recipients else [settings.NOTIFICATION_EMAIL]
)
email.attach('summary.txt', summary, 'text/plain')
Expand All @@ -364,7 +364,7 @@ def sendBillerCodeEmail(summaries,monthly=False):
email = EmailMessage(
subject,
content,
settings.DEFAULT_FROM_EMAIL,
settings.EMAIL_FROM,
to= recipients
)
email.attach('summary.txt', v, 'text/plain')
Expand Down
4 changes: 2 additions & 2 deletions ledger/payments/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def sendInterfaceParserEmail(trans_date,oracle_codes,system_name,system_id,error
email = EmailMessage(
'Oracle Interface for {} for transactions received on {}'.format(system_name,dt),
'Oracle Interface Summary File for {} for transactions received on {}'.format(system_name,dt),
settings.DEFAULT_FROM_EMAIL,
settings.EMAIL_FROM,
to=[r.email for r in recipients]if recipients else [settings.NOTIFICATION_EMAIL]
)
email.attach('OracleInterface_{}.csv'.format(dt), _file.getvalue(), 'text/csv')
Expand All @@ -242,7 +242,7 @@ def sendInterfaceParserEmail(trans_date,oracle_codes,system_name,system_id,error
subject = 'Oracle Interface Error for {} for transactions received on {}'.format(system_name,dt)
email = EmailMessage(subject,
'There was an error in generating a summary report for the oracle interface parser for transactions processed on {}.Please refer to the following log output:\n\n\n{}'.format(today,error_string),
settings.DEFAULT_FROM_EMAIL,
settings.EMAIL_FROM,
to=[r.email for r in recipients]if recipients else [settings.NOTIFICATION_EMAIL]
)

Expand Down
4 changes: 2 additions & 2 deletions ledger/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
EMAIL_FROM = env('EMAIL_FROM', ADMINS[0])
DEFAULT_FROM_EMAIL = EMAIL_FROM


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand Down Expand Up @@ -292,7 +291,8 @@
# Custom Email Settings
EMAIL_BACKEND = 'ledger.ledger_email.LedgerEmailBackend'
PRODUCTION_EMAIL = env('PRODUCTION_EMAIL', False)
#print PRODUCTION_EMAIL
# Intercept and forward email recipient for non-production instances
# Send to list of NON_PROD_EMAIL users instead
EMAIL_INSTANCE = env('EMAIL_INSTANCE','PROD')
NON_PROD_EMAIL = env('NON_PROD_EMAIL')
if not PRODUCTION_EMAIL:
Expand Down
2 changes: 1 addition & 1 deletion parkstay/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from ledger.emails.emails import EmailBase

default_campground_email = settings.CAMPGROUNDS_EMAIL
default_campground_email = settings.EMAIL_FROM
class TemplateEmailBase(EmailBase):
subject = ''
html_template = 'ps/email/base_email.html'
Expand Down
2 changes: 1 addition & 1 deletion parkstay/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def outstanding_bookings():
email = EmailMessage(
'Unpaid Bookings Summary as at {}'.format(dt),
'Unpaid Bookings as at {}'.format(dt),
settings.DEFAULT_FROM_EMAIL,
settings.EMAIL_FROM,
to=[r.email for r in recipients]if recipients else [settings.NOTIFICATION_EMAIL]
)
email.attach('OustandingBookings_{}.csv'.format(dt), _file.getvalue(), 'text/csv')
Expand Down
3 changes: 2 additions & 1 deletion parkstay/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
'level': 'INFO'
}

CAMPGROUNDS_EMAIL = env('CAMPGROUNDS_EMAIL','parkstaybookings@dbca.wa.gov.au')
EMAIL_FROM = env('EMAIL_FROM', ADMINS[0])
DEFAULT_FROM_EMAIL = EMAIL_FROM
EXPLORE_PARKS_URL = env('EXPLORE_PARKS_URL','https://parks-oim.dpaw.wa.gov.au')
PARKSTAY_EXTERNAL_URL = env('PARKSTAY_EXTERNAL_URL','https://parkstay.dbca.wa.gov.au')
DEV_STATIC = env('DEV_STATIC',False)
Expand Down
4 changes: 2 additions & 2 deletions wildlifelicensing/apps/applications/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def send_assessment_done_email(assessment, request):
'url': url
}
to_email = application.assigned_officer.email if application.assigned_officer else \
settings.WILDLIFELICENSING_EMAIL_CATCHALL
settings.EMAIL_FROM
msg = email.send(to_email, context=context)
_log_email(msg, application=application, sender=request.user)

Expand Down Expand Up @@ -324,7 +324,7 @@ def send_application_declined_email(declined_details, request):
recipient_email = application.proxy_applicant.email

msg = email.send(recipient_email, context=context)
sender = request.user if request else settings.DEFAULT_FROM_EMAIL
sender = request.user if request else settings.EMAIL_FROM
_log_email(msg, application=application, sender=sender)
return recipient_email

Expand Down
3 changes: 2 additions & 1 deletion wildlifelicensing/apps/main/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from django.core.files import File
from django.conf import settings
from wildlifelicensing.settings import EMAIL_FROM

from ledger.accounts.models import Document

Expand All @@ -24,7 +25,7 @@
LICENCE_HEADER_IMAGE_WIDTH = 170
LICENCE_HEADER_IMAGE_HEIGHT = 42

DPAW_EMAIL = 'wildlifelicensing@dpaw.wa.gov.au'
DPAW_EMAIL = EMAIL_FROM
DPAW_URL = 'www.dpaw.wa.gov.au'
DPAW_PHONE = '(08) 9219 9831'
DPAW_FAX = '(08) 9423 8242'
Expand Down
2 changes: 1 addition & 1 deletion wildlifelicensing/apps/returns/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def send_return_overdue_staff_email_notification(ret):
'return': ret
}

email.send(settings.WILDLIFELICENSING_EMAIL_CATCHALL, context=context)
email.send(settings.EMAIL_FROM, context=context)


class ReturnAmendmentRequestedEmail(TemplateEmailBase):
Expand Down
4 changes: 3 additions & 1 deletion wildlifelicensing/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
'wildlifelicensing.apps.returns.cron.CheckOverdueReturnsCronJob',
]

WILDLIFELICENSING_EMAIL_CATCHALL = env('WILDLIFELICENSING_EMAIL_CATCHALL', 'wildlifelicensing@dpaw.wa.gov.au')

HERBIE_SPECIES_WFS_URL = env('HERBIE_SPECIES_WFS_URL',
'https://kmi.dpaw.wa.gov.au/geoserver/ows?service=wfs&version=1.1.0&'
Expand All @@ -52,3 +51,6 @@
DEFAULT_HOST = env('DEFAULT_HOST', "https://wildlifelicensing.dpaw.wa.gov.au")
DATA_UPLOAD_MAX_NUMBER_FIELDS = env('DATA_UPLOAD_MAX_NUMBER_FIELDS', None)
WL_PDF_URL=env('WL_PDF_URL','https://wildlifelicensing.dpaw.wa.gov.au')

EMAIL_FROM = env('EMAIL_FROM', ADMINS[0])
DEFAULT_FROM_EMAIL = EMAIL_FROM

0 comments on commit 97ecb4d

Please sign in to comment.