Modules¶
-
class
certmailer.jobs.
Job
(name: str, job_data: dict = None)¶ Creates and access one job.
-
relative_path
(filename)¶ Return filepath relative to job path.
-
show_cache
()¶ Show how many files of each extension exists in cache.
-
-
class
certmailer.jobs.
JobFolder
(job, path)¶ To manage subfolders into data folder.
-
add
(filepath)¶ Add (copy) a new file into the folder
-
list
()¶ Returns the list of files into the folder
-
remove
(filename)¶ Remove a file from the subfolder
-
-
class
certmailer.jobs.
Jobs
¶ Jobs manager and container. Singleton.
-
current_job
¶ Return current job
-
list
()¶ List all the jobs.
-
new
(name, job_data)¶ Creates the basic template of a job
-
remove
(name)¶ Removes a job folder.
-
-
class
certmailer.gen_mail.
GenMail
(job, template)¶ Generates all the PDF and Emails
-
clean_n_log
(receiver)¶ Clear information and writes the log.
-
classmethod
get_filename
(email, certificate='')¶ Creates a filename for certificate
-
process
(receiver)¶ Creates PDF certificates, and prepares email replacing variables in templates
-
sendmail
(receiver)¶ Calls the api to actually send the mails
-
-
class
certmailer.gen_pdf.
GenPDF
(svg_source, images=None)¶ Adapted
-
process
(result_filename, replace_info, pdf_optimized=False)¶ Gen PDF. PDF is from a key in replace_info, replacing data into the svg_source, and naming each PDF according to result_*.
If pdf_optimized in True, Ghostscript will be called to improve the final file.
-
-
class
certmailer.receivers.
Receiver
(email: str = None, values: dict = None)¶ Represents an email receiver.
-
add_generated
(filename)¶ Add a newly generated attached file.
-
from_row
(row)¶ Reads a csv’s row and complete the receiver’s data.
-
to_row
(fieldnames: list)¶ Extract data from internal structures and put in a csv’s row.
-
-
class
certmailer.receivers.
Receivers
(job)¶ Persists in a csv the data collected from receivers
-
describe
()¶ Describe de csv, put every column and how many cell has values in it.
-
exists
()¶ If receivers’ csv is created.
-
filename
¶ Name of receivers’ csv file
-
mails_to_send
(flag='TOTAL')¶ Calculates how many emails will be sent.
-
read
(flag='')¶ Reads every receiver, a create receiver object.
-
send_flags
()¶ Check how many mails will be sent, group by flag. TOTAL is a special flag, meaning the grand total.
-
write
(do)¶ Writes receivers collected. It may use eventoL exported files
-
-
class
certmailer.make_template.
Template
(job)¶ Creates the email template data structure from job’s files.
-
format
(replace_info)¶ Replace fields with correspondent email receiver data.
-
Create a csv list of candidates to do a certificate