include ./notification

mixin reconfirmAffiliationNotification-marketing(userEmail, location)
	- var ssoEnabled = userEmail.affiliation && userEmail.affiliation.institution && userEmail.affiliation.institution.ssoEnabled
	if ssoEnabled
		- var institutionId = userEmail.affiliation && userEmail.affiliation.institution && userEmail.affiliation.institution.id
		a.btn-reconfirm.btn.btn-sm.btn-secondary(
			data-ol-slow-link
			href=`${settings.saml.ukamf.initPath}?university_id=${institutionId}&reconfirm=${location}`
		)
			span(data-ol-inflight='idle') #{translate("confirm_affiliation")}
			span(hidden data-ol-inflight='pending') #{translate("pending")}…

	else
		a.btn-reconfirm.btn.btn-sm.btn-secondary(
			data-ol-slow-link
			href='/user/settings'
		)
			span(data-ol-inflight='idle') #{translate("go_to_account_settings")}
			span(hidden data-ol-inflight='pending') #{translate("redirecting")}… 

	| !{translate("are_you_still_at", { institutionName: userEmail.affiliation.institution.name }, ['strong'])}&nbsp;

	if location == '/user/settings'
		| !{translate('please_reconfirm_institutional_email', {}, [{ name: 'span' }])}
		if userEmail.default
			span &nbsp;#{translate('need_to_add_new_primary_before_remove')}
	else
		| !{translate("please_reconfirm_institutional_email_2")}

	| &nbsp;
	a(href='/learn/how-to/Institutional_Email_Reconfirmation' target='_blank') #{translate("learn_more_about_email_reconfirmation")}

mixin reconfirmedAffiliationNotification-marketing(userEmail)
	| !{translate("your_affiliation_is_confirmed", {institutionName: userEmail.affiliation.institution.name}, ['strong'])}
	|
	| #{translate('thank_you_exclamation')}
