common/app/views/fragments/email/signup/subscription/emailSignUp.scala.html
@import services.newsletters.model.EmailEmbed @( componentClass: String, identityName:String, newsletterName: String, description: String, iframeParentComponent: Option[String])(implicit request: RequestHeader) @import common.LinkTo @import conf.switches.Switches.EmailSignupRecaptcha @import conf.switches.Switches.ShowNewPrivacyWordingOnEmailSignupEmbeds @* TODO - remove custom tones? This fragment will only be used in older articles which include email sign up forms by using and Embed element in the CAPI content which includes the HTML for an iframe loading the form page. This method was phased out form July 2022 - see https://github.com/guardian/frontend/pull/25228. We don't need to support custom "tones" for new articles or newsletters - leaving the identityNamesTones in place to avoid changing the appearance of old articles. Would be possible to identify relevant articles by searching CAPI for articles with the string "https://www.theguardian.com/email/form/plaintone" in the body. *@ @identityNamesTones = @{ List( "best-of-opinion" -> "comment", "best-of-opinion-au" -> "comment", "best-of-opinion-us" -> "comment", "bookmarks" -> "review", "the-fiver" -> "feature", "the-long-read" -> "feature", "documentaries" -> "plaindark", "the-flyer" -> "feature", "the-breakdown" -> "feature", "the-spin" -> "feature", "film-today" -> "media", "sleeve-notes" -> "review", "observer-food" -> "feature", "first-dog" -> "media", "fashion-statement" -> "media" ).toMap: Map[String, String] } @formId = @{ componentClass + "-email-sub-form" } @inputId = @{ componentClass + "-email-sub-input" } @dummyInputId = @{ componentClass + "-email-sub-input-name" } @wrapperClass = @{ "email-sub" + " email-sub--" + componentClass } @wrapperToneClass = @{ if (componentClass == "plaintone") "email-sub--tone-" + identityNamesTones.getOrElse(identityName, "news") } @formClass = @{ "email-sub__form" + " email-sub__form--" + componentClass } @headerClass = @{"email-sub__header" + " email-sub__header--" + componentClass } @parentSuffix = @{iframeParentComponent.map(" " + _).getOrElse("")} @buttonDataComponent = @{ "email-signup-button " + componentClass + "-" + identityName + parentSuffix } @formDataComponent = @{ "email-signup-form " + componentClass + "-" + identityName + parentSuffix } @form = {
@helper.CSRF.formField
@fragments.inlineSvg("envelope", "icon", Seq("label__icon"))Enter your email address @fragments.inlineSvg("envelope", "icon", Seq("submit-input__icon"))Sign up @if(EmailSignupRecaptcha.isSwitchedOn && ShowNewPrivacyWordingOnEmailSignupEmbeds.isSwitchedOn) { @fragments.email.signup.recaptchaContainer() @fragments.email.signup.recaptchaTerms(fragments.email.signup.privacyNoticeContent()) } else if(EmailSignupRecaptcha.isSwitchedOn) { @fragments.email.signup.recaptchaContainer() @fragments.email.signup.recaptchaTerms() } else if(ShowNewPrivacyWordingOnEmailSignupEmbeds.isSwitchedOn) { @fragments.email.signup.privacyNoticeContent() } }
@Html(description)
@form