Commit bd356bc9 authored by Stephane Glondu's avatar Stephane Glondu

Warn the voter when she has revoted in confirmation email

parent 8528bcf6
......@@ -49,7 +49,7 @@ module Make (E : ELECTION with type 'a m = 'a Lwt.t) : WEB_BALLOT_BOX = struct
with Not_found ->
Ocsipersist.add cred_table cred None
let send_confirmation_email user email hash =
let send_confirmation_email revote user email hash =
let title = E.election.e_params.e_name in
let uuid = E.election.e_params.e_uuid in
let%lwt metadata = Web_persist.get_election_metadata uuid in
......@@ -64,7 +64,8 @@ module Make (E : ELECTION with type 'a m = 'a Lwt.t) : WEB_BALLOT_BOX = struct
let module L = (val Web_i18n.get_lang language) in
let subject = Printf.sprintf L.mail_confirmation_subject title in
let contact = Web_templates.contact_footer metadata L.please_contact in
let body = Printf.sprintf L.mail_confirmation user title hash url1 url2 contact in
let revote = if revote then L.this_vote_replaces else "" in
let body = Printf.sprintf L.mail_confirmation user title hash revote url1 url2 contact in
send_email email subject body
let do_cast rawballot (user, date) =
......@@ -111,7 +112,7 @@ module Make (E : ELECTION with type 'a m = 'a Lwt.t) : WEB_BALLOT_BOX = struct
Ocsipersist.add cred_table credential (Some hash) >>
Ocsipersist.add ballots_table hash rawballot >>
Ocsipersist.add records_table user (date, credential) >>
send_confirmation_email login email hash >>
send_confirmation_email false login email hash >>
return hash
) else (
fail ProofCheck
......@@ -126,7 +127,7 @@ module Make (E : ELECTION with type 'a m = 'a Lwt.t) : WEB_BALLOT_BOX = struct
Ocsipersist.add cred_table credential (Some hash) >>
Ocsipersist.add ballots_table hash rawballot >>
Ocsipersist.add records_table user (date, credential) >>
send_confirmation_email login email hash >>
send_confirmation_email true login email hash >>
return hash
) else (
fail ProofCheck
......
......@@ -119,7 +119,8 @@ module type LocalizedStrings = sig
val mail_credential_password : string
val mail_credential_cas : string
val mail_confirmation_subject : (string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_confirmation : (string -> string -> string -> string -> string -> string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val mail_confirmation : (string -> string -> string -> string -> string -> string -> string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val this_vote_replaces : string
val please_contact : string
val error_Serialization : (string -> 'f, 'b, 'c, 'e, 'e, 'f) format6
val error_ProofCheck : string
......
......@@ -175,7 +175,7 @@ Ihre Stimme zur Abstimmung
wurde angenommen. Ihre Stimmennummer ist:
%s
%s%s
Mit dieser Nummer können Sie überprüfen, ob sich Ihre Stimme in der
......@@ -187,6 +187,7 @@ Das Ergebnis wird auf der Website der Abstimmung veröffentlicht:
-- \nBelenios"
let this_vote_replaces = "\n\nThis vote replaces any previous vote."
let please_contact = "To get more information, please contact:"
let error_Serialization : ('a, 'b, 'c, 'd, 'e, 'f) format6 = "your ballot has a syntax error (%s)"
......
......@@ -174,7 +174,7 @@ Your vote for election
has been recorded. Your smart ballot tracker is
%s
%s%s
You can check its presence in the ballot box, accessible at
......@@ -185,6 +185,7 @@ Results will be published on the election page
-- \nBelenios"
let this_vote_replaces = "\n\nThis vote replaces any previous vote."
let please_contact = "To get more information, please contact:"
let error_Serialization : ('a, 'b, 'c, 'd, 'e, 'f) format6 = "your ballot has a syntax error (%s)"
......
......@@ -177,7 +177,7 @@ Votre vote pour l'élection
a été enregistré. Votre numéro de suivi est
%s
%s%s
Vous pouvez vérifier sa présence dans l'urne, accessible au
......@@ -188,6 +188,7 @@ Les résultats seront publiés sur la page de l'élection
-- \nBelenios"
let this_vote_replaces = "\n\nCe vote remplace le vote précédent."
let please_contact = "Pour obtenir plus d'informations, veuillez contacter :"
let error_Serialization : ('a, 'b, 'c, 'd, 'e, 'f) format6 = "votre bulletin a une erreur de syntaxe (%s)"
......
......@@ -179,7 +179,7 @@ La sua scheda per l'elezione
è stata registrata. Il suo codice di verifica è
%s
%s%s
Può verificare la sua presenza nell'urna, accessibile su
......@@ -190,6 +190,7 @@ I risultati saranno pubblicati sulla pagina dell'elezione
-- \nBelenios"
let this_vote_replaces = "\n\nThis vote replaces any previous vote."
let please_contact = "To get more information, please contact:"
let error_Serialization : ('a, 'b, 'c, 'd, 'e, 'f) format6 = "your ballot has a syntax error (%s)"
......
......@@ -176,7 +176,7 @@ Votul vostru pentru alegerea
a fost înregistrat. Numărul vostru de identificare este
%s
%s%s
Puteți verifica prezența acestuia în urma de vot, accesibilă la
......@@ -187,6 +187,7 @@ Rezultatele vor fi publicate pe pagina de alegere
-- \nBelenios"
let this_vote_replaces = "\n\nThis vote replaces any previous vote."
let please_contact = "To get more information, please contact:"
let error_Serialization : ('a, 'b, 'c, 'd, 'e, 'f) format6 = "your ballot has a syntax error (%s)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment