<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"use strict";(self.webpackChunkneosync=self.webpackChunkneosync||[]).push([[180],{2499:(e,t,a)=&gt;{a.r(t),a.d(t,{assets:()=&gt;u,contentTitle:()=&gt;l,default:()=&gt;f,frontMatter:()=&gt;o,metadata:()=&gt;m,toc:()=&gt;d});var n=a(7462),i=(a(7294),a(3905)),s=a(2021),r=a(2524);const o={title:"Email",id:"email",hide_title:!0,slug:"/transformers/system/email"},l=void 0,m={unversionedId:"transformers/system/email",id:"transformers/system/email",title:"Email",description:"&lt;TransformerPageHeader",source:"@site/docs/transformers/system/email.mdx",sourceDirName:"transformers/system",slug:"/transformers/system/email",permalink:"/transformers/system/email",draft:!1,editUrl:"https://github.com/nucleuscloud/neosync/docs/docs/transformers/system/email.mdx",tags:[],version:"current",frontMatter:{title:"Email",id:"email",hide_title:!0,slug:"/transformers/system/email"},sidebar:"mainSideBar",previous:{title:"Introduction",permalink:"/transformers/introduction"},next:{title:"Phone (integer)",permalink:"/transformers/system/int-phone"}},u={},d=[{value:"Definition",id:"definition",level:2},{value:"Configurations",id:"configurations",level:2},{value:"Examples",id:"examples",level:2}],p={toc:d},c="wrapper";function f(e){let{components:t,...a}=e;return(0,i.kt)(c,(0,n.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)(s.M,{title:"Email",type:"string",apiRef:"https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/email.go",mdxType:"TransformerPageHeader"}),(0,i.kt)("h2",{id:"definition"},"Definition"),(0,i.kt)("p",null,"The email transformer can anonymize an existing email address or completely generate a new one. An email is made up of three parts:"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"&lt;username&gt;@&lt;domain&gt;.&lt;top-level-domain&gt;")),(0,i.kt)("p",null,"By default, the transformer randomizes the username, domain and top-level domain while always preserving the email format by retaining the @ and . characters."),(0,i.kt)("p",null,"For example, the following input value:\n",(0,i.kt)("inlineCode",{parentName:"p"},"john@acme.com")),(0,i.kt)("p",null,"Would produce the following ouput value:\n",(0,i.kt)("inlineCode",{parentName:"p"},"ytvub873@ksh0293.com")),(0,i.kt)("p",null,"You can see we generated new privacy-safe values for the username and the domain. You can update this structure using the configurations below. Lastly, the email transformer takes in a ",(0,i.kt)("inlineCode",{parentName:"p"},"string")," and returns a ",(0,i.kt)("inlineCode",{parentName:"p"},"string"),"."),(0,i.kt)("h2",{id:"configurations"},"Configurations"),(0,i.kt)("p",null,"Depending on your validations, you may want to configure the output email. The email transformer has the following configurations:"),(0,i.kt)(r.H,{headers:["Name","Description","Default","Example Input","Example Output"],rowData:[{data:["PreserveDomain","Preserve Domain carries over the input domain to the output email address. This includes the domain and top-level domain.","false","john@gmail.com","fjf2903@gmail.com"]},{data:["PreserveLength","Preserve Length will ensure that the output email address is the same length as the input email address. This includes the domain as well.","false","john@gmail.com","hw98@gmail.com"]}],mdxType:"DocsTable"}),(0,i.kt)("h2",{id:"examples"},"Examples"),(0,i.kt)("p",null,"There are several ways you can mix-and-match configurations to get different potential email formats. Here are some possible combinations:"),(0,i.kt)(r.H,{headers:["PreserveLength","PreserveDomain","Example Input","Example Output"],rowData:[{data:["false","true","joe@gmail.com","f98723uh@gmail.com"]},{data:["true","false","joe@gmail.com","9cd@ms0ej.com"]},{data:["true","true","joe@gmail.com","mDy@bdo3s.com"]},{data:["false","false","joe@gmail.com","fweq23f@fheuiw78.edu"]}],mdxType:"DocsTable"}))}f.isMDXComponent=!0}}]);</pre></body></html>