Models

class jmb.newsletter.models.ActiveSubscriber(*args, **kwargs)[source]

ActiveSubscriber(id, date_create, date_last_modify, status, ordering, creator_id, last_modifier_id, mailinglist_id, contact_id, date_subscription, date_unsubscription, is_test_contact)

class jmb.newsletter.models.MailingList(*args, **kwargs)[source]

Mailing list: is a list of subscribers to some newsletters.

clone()[source]

clone mailinglist without contacts

get_subscribers()[source]

return Active Subscribers queryset

get_subscribers_count()[source]

return number of subscribtions

get_subscribers_url()[source]

return a link to the list of mailing list subscribers

get_test_subscribers()[source]

return Test Subscribers queryset

get_test_subscribers_count()[source]

return number of test subscribtions

get_test_subscribers_url()[source]

return a link to the list of mailing list subscribers of subscribtions

get_unsubscribers()[source]

return Unsubscribers queryset

get_unsubscribers_count()[source]

return number of unsubscribtions

get_unsubscribers_url()[source]

return a link to the list of mailing list subscribers of subscribtions

has_test_contact[source]

return True or False if Test Contacts are present

test_subscribers

return Test Subscribers queryset

total_subscribers

return number of subscribtions

total_test_subscribers

return number of test subscribtions

total_unsubscribers

return number of unsubscribtions

unsubscribers

return Unsubscribers queryset

class jmb.newsletter.models.Newsletter(*args, **kwargs)[source]

Newsletter to be sended to subscribers

active_subscribers

return all Subscribers queryset of newsletter

active_subscribers_count

return number active subscribers of newsletter

clone()[source]

clone Newsletter

get_absolute_url(*moreargs, **morekwargs)[source]

return preview url

get_active_subscribers()[source]

return Active Subscribers queryset of newsltter

get_active_subscribers_count()[source]

return number active subscribers of newsletter

get_active_subscribers_url()[source]

return an active subscribers changelist link of newsletter

get_default_template_path()[source]

return default template path

get_default_title()[source]

return default newsletter title

get_historic_url(*args, **kwargs)[source]

return historic url

get_html_mailinglists()[source]

return a html string of mailing list names separated by ‘<br/>

get_list_mailinglists()[source]

return list of mailing list names

get_statistics_url(*args, **kwargs)[source]

return statistics url

get_string_mailinglists(separator=', ')[source]

return a string of mailing list names separated by separator

get_subscribers()[source]

return all Subscribers queryset of newsletter

get_subscribers_count()[source]

return number subscribers of newsletter

get_subscribers_url()[source]

return a subscribers changelist link of newsletter

get_test_subscribers()[source]

return Test Subscribers queryset of newsletter

get_test_subscribers_count()[source]

return number test subscribers of newsletter

get_test_subscribers_url()[source]

return a test subscribers changelist link of newsletter

get_unsubscribers()[source]

return Unsubscribers queryset of newsletter

get_unsubscribers_count()[source]

return number unsubscribers of newsletter

get_unsubscribers_url()[source]

return a unsubscribers changelist link of newsletter

send(mailing_list=None)[source]

method to send newsletter

send_in_test(mailing_list=None)[source]

method to send newsletter in test

subscribers

return all Subscribers queryset of newsletter

subscribers_count

return number subscribers of newsletter

test_subscribers

return Test Subscribers queryset of newsletter

test_subscribers_count

return number test subscribers of newsletter

unsubscribers

return Unsubscribers queryset of newsletter

unsubscribers_count

return number unsubscribers of newsletter

unsubscriptions_perc[source]

return percentage of unsubscribtions

class jmb.newsletter.models.NewsletterEmailObject(*args, **kwargs)[source]

NewsletterEmailObject(id, date_create, date_last_modify, ordering, creator_id, last_modifier_id, status, email_address, subject, content, smtp_server_id, bounce_server_id, header_sender, header_reply, slug, emailobject_ptr_id, newsletter_id, subscriber_id)

class jmb.newsletter.models.NewsletterTemplate(*args, **kwargs)[source]

NewsletterTemplate(id, date_create, date_last_modify, ordering, creator_id, last_modifier_id, name, file)

class jmb.newsletter.models.Settings(*args, **kwargs)[source]

Settings(id, date_create, date_last_modify, creator_id, last_modifier_id, name, value, description, type)

class jmb.newsletter.models.Subscriber(*args, **kwargs)[source]

Subscription to a mailing list

get_token()[source]

Return a token of a contact

get_tokens()[source]

Return the uid in base 36 of a contact, and a token

get_uidb36()[source]

Return the uid in base 36 of a contact

is_active()[source]

Checks if subscriber is active due to its status field :return: Boolean flag

is_contact_active()[source]

Checks if subscriber related contact is active due to its status field :return: Boolean flag

is_subscribed()[source]

Checks if a subscriber is subscribed from its mailing list :return: Boolean flag

is_test_subscriber()[source]

Checks if subscriber is a test one due to its is_test_contact field :return: Boolean flag

is_unsubscribed()[source]

Checks if a subscriber is unsubscribed from its mailing list :return: Boolean flag

resend_all_newsletter(newsletter)[source]

Prepare a new email object for every subscriber without checking if the subscriber has already received the email. Email sending is made by background cron task (jmb.mailer.send_mails) :param newsletter: A newsletter instance to be sent via email :return: boolean flag of creation succesfully done, custom message

resend_newsletter(newsletter)[source]

Prepare a new email object for every subscriber has already received the email of the newsletter. Email sending is made by background cron task (jmb.mailer.send_mails) :param newsletter: A newsletter instance to be sent via email :return: boolean flag of creation succesfully done, custom message

send_in_test_newsletter(newsletter)[source]

Prepare and send an email to the subscriber containing newsletter. :param newsletter: A newsletter instance to be sent via email :return: boolean flag of creation succesfully done, custom message

send_newsletter(newsletter)[source]

Prepare an email object the subscriber will receive containing newsletter only if not already sent. Email sending is made by background cron task (jmb.mailer.send_mails) :param newsletter: A newsletter instance to be sent via email :return: boolean flag of creation succesfully done, custom message

unsubscribe_from_mailinglist(mailing_list)[source]

Unsubscribe the subscriber from a given mailing_list :param newsletter: A newsletter instance to be sent via email :return: boolean flag of creation succesfully done, custom message

class jmb.newsletter.models.TestSubscriber(*args, **kwargs)[source]

TestSubscriber(id, date_create, date_last_modify, status, ordering, creator_id, last_modifier_id, mailinglist_id, contact_id, date_subscription, date_unsubscription, is_test_contact)

class jmb.newsletter.models.Unsubscriber(*args, **kwargs)[source]

Unsubscriber(id, date_create, date_last_modify, status, ordering, creator_id, last_modifier_id, mailinglist_id, contact_id, date_subscription, date_unsubscription, is_test_contact)

Previous topic

Commands

This Page