Skip to content

Commit 8a37502

Browse files
authored
Merge pull request #92 from Jaspreet-singh-1032/issue-83-use-template-to-send-email
added documentation
2 parents 083aafe + d6243e7 commit 8a37502

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ As with imports, a fully configured example project can be found in the `example
141141
user=OuterRef("pk")).values("type")[:1])
142142
4. Done!
143143

144+
144145
Performing exports with celery
145146
------------------------------
146147

@@ -156,6 +157,44 @@ Performing exports with celery
156157

157158
6. Click on the link near the bottom of the page titled `Exported file`.
158159

160+
161+
162+
Customizing email template for export job completion email
163+
---------------------------------------------------------
164+
165+
By default this is the subject and template used to send the email
166+
167+
168+
::
169+
170+
Subject: 'Django: Export job completed'
171+
Email template: 'email/export_job_completion.html'
172+
173+
174+
The default email template can be found `here <https://github.com/auto-mat/django-import-export-celery/blob/master/import_export_celery/templates/email/export_job_completion.html>`__
175+
176+
The default email subject and template can be customized by overriding these values from django settings:-
177+
178+
179+
::
180+
181+
EXPORT_JOB_COMPLETION_MAIL_SUBJECT="Your custom subject"
182+
EXPORT_JOB_COMPLETION_MAIL_TEMPLATE="path_to_folder/your_custom_template.html"
183+
184+
185+
The email template will get some context variables that you can use to customize your template.
186+
187+
188+
::
189+
190+
{
191+
export_job: The current instance of ExportJob model
192+
app_label: export_job.app_label
193+
model: export_job.model
194+
link: A link to go to the export_job instance on django admin
195+
}
196+
197+
159198
For developers of this library
160199
------------------------------
161200

0 commit comments

Comments
 (0)