event listener to send emails when election is published