# Preview all emails at http://localhost:3000/rails/mailers/petition_mailer
class PetitionMailerPreview < ActionMailer::Preview
def email_confirmation_for_signer - PetitionMailerPreview#email_confirmation_for_signer doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.email_confirmation_for_signer(Signature.last)
end
def email_duplicate_signatures - PetitionMailerPreview#email_duplicate_signatures doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.email_duplicate_signatures(Signature.last)
end
def gather_sponsors_for_petition - PetitionMailerPreview#gather_sponsors_for_petition doesn't depend on instance state (maybe move it to another class?)
PetitionMailer.gather_sponsors_for_petition(Petition.last)
end
def email_signer - PetitionMailerPreview#email_signer doesn't depend on instance state (maybe move it to another class?)
email = Petition::Email.last
petition = email.petition
signature = petition.signatures.validated.last
PetitionMailer.email_signer(petition, signature, email)
end
def email_creator - PetitionMailerPreview#email_creator doesn't depend on instance state (maybe move it to another class?)
email = Petition::Email.last
petition = email.petition
signature = petition.creator
PetitionMailer.email_creator(petition, signature, email)
end
def notify_creator_that_moderation_is_delayed - PetitionMailerPreview#notify_creator_that_moderation_is_delayed doesn't depend on instance state (maybe move it to another class?)
petition = Petition.overdue_in_moderation.last
signature = petition.creator
subject = "Moderation of your petition has been delayed"
body = "We are sorry, but moderation of your petition has been delayed due to an overwhelming number of requests."
PetitionMailer.notify_creator_that_moderation_is_delayed(signature, subject, body)
end
def notify_signer_of_threshold_response - PetitionMailerPreview#notify_signer_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Petition.with_response.last
signature = petition.signatures.validated.last
PetitionMailer.notify_signer_of_threshold_response(petition, signature)
end
def notify_creator_of_threshold_response - PetitionMailerPreview#notify_creator_of_threshold_response doesn't depend on instance state (maybe move it to another class?)
petition = Petition.with_response.last
signature = petition.creator
PetitionMailer.notify_creator_of_threshold_response(petition, signature)
end
def notify_creator_of_closing_date_change - PetitionMailerPreview#notify_creator_of_closing_date_change doesn't depend on instance state (maybe move it to another class?)
petition = Petition.open_at_dissolution.first
signature = petition.creator
PetitionMailer.notify_creator_of_closing_date_change(signature)
end
def notify_creator_of_sponsored_petition_being_stopped - PetitionMailerPreview#notify_creator_of_sponsored_petition_being_stopped doesn't depend on instance state (maybe move it to another class?)
petition = Petition.where(state: "sponsored").last
signature = petition.creator
PetitionMailer.notify_creator_of_sponsored_petition_being_stopped(signature)
end
def notify_creator_of_validated_petition_being_stopped - PetitionMailerPreview#notify_creator_of_validated_petition_being_stopped doesn't depend on instance state (maybe move it to another class?)
petition = Petition.where(state: "validated").last
signature = petition.creator
PetitionMailer.notify_creator_of_validated_petition_being_stopped(signature)
end
def debated_petition_signer_notification - PetitionMailerPreview#debated_petition_signer_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.debated.last
signature = petition.signatures.validated.last
PetitionMailer.notify_signer_of_debate_outcome(petition, signature)
end
def debated_petition_creator_notification - PetitionMailerPreview#debated_petition_creator_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.debated.last
signature = petition.signatures.validated.last
PetitionMailer.notify_creator_of_debate_outcome(petition, signature)
end
def not_debated_petition_signer_notification - PetitionMailerPreview#not_debated_petition_signer_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.not_debated.last
signature = petition.signatures.validated.last
PetitionMailer.notify_signer_of_debate_outcome(petition, signature)
end
def not_debated_petition_creator_notification - PetitionMailerPreview#not_debated_petition_creator_notification doesn't depend on instance state (maybe move it to another class?)
petition = Petition.not_debated.last
signature = petition.signatures.validated.last
PetitionMailer.notify_creator_of_debate_outcome(petition, signature)
end
end