<% if ( interaction?.media?.type === 'email' && interaction.state === 'done' && interaction?.media?.sent_at !== null && interaction.current_service.type === 'MAILIN' && interaction.interaction_ref === null ) {%> <% }%>