[{"data":1,"prerenderedAt":1877},["ShallowReactive",2],{"navigation_docs":3,"-sending-profiles-and-config":205,"-sending-profiles-and-config-surround":1872},[4,31,67,111,132,163,189],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":30},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20,25],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-play",{"title":26,"path":27,"stem":28,"icon":29},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F4.agent-skill","i-lucide-sparkles",false,{"title":32,"icon":33,"path":34,"stem":35,"children":36,"page":30},"Authoring","i-lucide-pen-line","\u002Fauthoring","2.authoring",[37,42,47,52,57,62],{"title":38,"path":39,"stem":40,"icon":41},"Comark syntax","\u002Fauthoring\u002Fcomark-syntax","2.authoring\u002F1.comark-syntax","i-lucide-file-code",{"title":43,"path":44,"stem":45,"icon":46},"Frontmatter","\u002Fauthoring\u002Ffrontmatter","2.authoring\u002F2.frontmatter","i-lucide-heading",{"title":48,"path":49,"stem":50,"icon":51},"Components","\u002Fauthoring\u002Fcomponents","2.authoring\u002F3.components","i-lucide-blocks",{"title":53,"path":54,"stem":55,"icon":56},"Merge tags and data","\u002Fauthoring\u002Fmerge-tags-and-data","2.authoring\u002F4.merge-tags-and-data","i-lucide-braces",{"title":58,"path":59,"stem":60,"icon":61},"Actions and spans","\u002Fauthoring\u002Factions-and-spans","2.authoring\u002F5.actions-and-spans","i-lucide-mouse-pointer-click",{"title":63,"path":64,"stem":65,"icon":66},"Compile errors","\u002Fauthoring\u002Fcompile-errors","2.authoring\u002F6.compile-errors","i-lucide-circle-alert",{"title":68,"icon":69,"path":70,"stem":71,"children":72,"page":30},"Kits","i-lucide-palette","\u002Fkits","3.kits",[73,78,83,87,91,96,101,106],{"title":74,"path":75,"stem":76,"icon":77},"What is a kit","\u002Fkits\u002Fwhat-is-a-kit","3.kits\u002F1.what-is-a-kit","i-lucide-package",{"title":79,"path":80,"stem":81,"icon":82},"kit.yaml","\u002Fkits\u002Fkit-yaml","3.kits\u002F2.kit-yaml","i-lucide-file-cog",{"title":84,"path":85,"stem":86,"icon":51},"Component schemas","\u002Fkits\u002Fcomponent-schemas","3.kits\u002F3.component-schemas",{"title":88,"path":89,"stem":90,"icon":56},"Templates and views","\u002Fkits\u002Ftemplates-and-views","3.kits\u002F4.templates-and-views",{"title":92,"path":93,"stem":94,"icon":95},"Template checking","\u002Fkits\u002Ftemplate-checking","3.kits\u002F5.template-checking","i-lucide-shield-check",{"title":97,"path":98,"stem":99,"icon":100},"Go types and funcs","\u002Fkits\u002Fgo-types-and-funcs","3.kits\u002F6.go-types-and-funcs","i-lucide-code",{"title":102,"path":103,"stem":104,"icon":105},"Email-safe HTML","\u002Fkits\u002Femail-safe-html","3.kits\u002F7.email-safe-html","i-lucide-mail-check",{"title":107,"path":108,"stem":109,"icon":110},"Plain text","\u002Fkits\u002Fplain-text","3.kits\u002F8.plain-text","i-lucide-file-text",{"title":112,"icon":113,"path":114,"stem":115,"children":116,"page":30},"Sending","i-lucide-send","\u002Fsending","4.sending",[117,122,127],{"title":118,"path":119,"stem":120,"icon":121},"Profiles and config","\u002Fsending\u002Fprofiles-and-config","4.sending\u002F1.profiles-and-config","i-lucide-settings",{"title":123,"path":124,"stem":125,"icon":126},"Message and MIME","\u002Fsending\u002Fmessage-and-mime","4.sending\u002F2.message-and-mime","i-lucide-mail",{"title":128,"path":129,"stem":130,"icon":131},"SMTP","\u002Fsending\u002Fsmtp","4.sending\u002F3.smtp","i-lucide-server",{"title":133,"icon":134,"path":135,"stem":136,"children":137,"page":30},"Tooling","i-lucide-wrench","\u002Ftooling","5.tooling",[138,143,148,153,158],{"title":139,"path":140,"stem":141,"icon":142},"The lttr CLI","\u002Ftooling\u002Fcli","5.tooling\u002F1.cli","i-lucide-terminal",{"title":144,"path":145,"stem":146,"icon":147},"Studio","\u002Ftooling\u002Fstudio","5.tooling\u002F2.studio","i-lucide-eye",{"title":149,"path":150,"stem":151,"icon":152},"Editor setup","\u002Ftooling\u002Feditor-setup","5.tooling\u002F3.editor-setup","i-lucide-plug",{"title":154,"path":155,"stem":156,"icon":157},"Screenshots","\u002Ftooling\u002Fscreenshots","5.tooling\u002F4.screenshots","i-lucide-camera",{"title":159,"path":160,"stem":161,"icon":162},"Goldens and testing","\u002Ftooling\u002Fgoldens-and-testing","5.tooling\u002F5.goldens-and-testing","i-lucide-flask-conical",{"title":164,"icon":165,"path":166,"stem":167,"children":168,"page":30},"Guides","i-lucide-book-open","\u002Fguides","6.guides",[169,174,179,184],{"title":170,"path":171,"stem":172,"icon":173},"Build your own kit","\u002Fguides\u002Fbuild-your-own-kit","6.guides\u002F1.build-your-own-kit","i-lucide-hammer",{"title":175,"path":176,"stem":177,"icon":178},"The Quiet kit","\u002Fguides\u002Fthe-quiet-kit","6.guides\u002F2.the-quiet-kit","i-lucide-mail-open",{"title":180,"path":181,"stem":182,"icon":183},"Migrating from v0.1","\u002Fguides\u002Fmigrating-from-v0-1","6.guides\u002F3.migrating-from-v0-1","i-lucide-arrow-right-left",{"title":185,"path":186,"stem":187,"icon":188},"Releasing","\u002Fguides\u002Freleasing","6.guides\u002F4.releasing","i-lucide-tag",{"title":190,"icon":191,"path":192,"stem":193,"children":194,"page":30},"Reference","i-lucide-library","\u002Freference","7.reference",[195,200],{"title":196,"path":197,"stem":198,"icon":199},"API reference","\u002Freference\u002Fapi-reference","7.reference\u002F1.api-reference","i-lucide-list-tree",{"title":201,"path":202,"stem":203,"icon":204},"Gallery","\u002Freference\u002Fgallery","7.reference\u002F2.gallery","i-lucide-images",{"id":206,"title":118,"body":207,"description":1865,"extension":1866,"links":1867,"meta":1868,"navigation":1869,"path":119,"seo":1870,"stem":120,"__hash__":1871},"docs\u002F4.sending\u002F1.profiles-and-config.md",{"type":208,"value":209,"toc":1855},"minimark",[210,231,236,333,463,471,475,478,529,544,548,622,734,741,745,756,825,855,859,877,912,916,956,961,1155,1164,1180,1186,1277,1285,1288,1306,1633,1638,1805,1820,1824,1851],[211,212,213,214,218,219,222,223,226,227,230],"p",{},"Rendering takes two pieces you fill in: one or more ",[215,216,217],"code",{},"Profile","s, which say who a message is from and what it carries, and a ",[215,220,221],{},"Config"," that ties them to a kit. ",[215,224,225],{},"NewRenderer"," checks all of it and hands back an immutable ",[215,228,229],{},"*Renderer"," — or every problem at once, before any template runs.",[232,233,235],"h2",{"id":234},"define-a-profile","Define a profile",[237,238,244],"pre",{"className":239,"code":240,"filename":241,"language":242,"meta":243,"style":243},"language-go shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","type Profile struct {\n    Name            string\n    From            mail.Address\n    FromDomain      string\n    Headers         map[string]string\n    ListUnsubscribe bool\n}\n","profile.go","go","",[215,245,246,266,275,290,298,318,327],{"__ignoreMap":243},[247,248,251,255,259,262],"span",{"class":249,"line":250},"line",1,[247,252,254],{"class":253},"s1Q0q","type",[247,256,258],{"class":257},"sSlKG"," Profile",[247,260,261],{"class":253}," struct",[247,263,265],{"class":264},"sihDN"," {\n",[247,267,269,272],{"class":249,"line":268},2,[247,270,271],{"class":264},"    Name            ",[247,273,274],{"class":253},"string\n",[247,276,278,281,284,287],{"class":249,"line":277},3,[247,279,280],{"class":264},"    From            ",[247,282,283],{"class":257},"mail",[247,285,286],{"class":264},".",[247,288,289],{"class":257},"Address\n",[247,291,293,296],{"class":249,"line":292},4,[247,294,295],{"class":264},"    FromDomain      ",[247,297,274],{"class":253},[247,299,301,304,307,310,313,316],{"class":249,"line":300},5,[247,302,303],{"class":264},"    Headers         ",[247,305,306],{"class":253},"map",[247,308,309],{"class":264},"[",[247,311,312],{"class":253},"string",[247,314,315],{"class":264},"]",[247,317,274],{"class":253},[247,319,321,324],{"class":249,"line":320},6,[247,322,323],{"class":264},"    ListUnsubscribe ",[247,325,326],{"class":253},"bool\n",[247,328,330],{"class":249,"line":329},7,[247,331,332],{"class":264},"}\n",[334,335,336,352],"table",{},[337,338,339],"thead",{},[340,341,342,346,349],"tr",{},[343,344,345],"th",{},"Field",[343,347,348],{},"Rule",[343,350,351],{},"Meaning",[353,354,355,380,397,416,442],"tbody",{},[340,356,357,363,369],{},[358,359,360],"td",{},[215,361,362],{},"Name",[358,364,365,366],{},"non-empty, unique in ",[215,367,368],{},"Config.Profiles",[358,370,371,372,375,376,379],{},"What a template's frontmatter ",[215,373,374],{},"profile:"," names. Copied to ",[215,377,378],{},"Message.Profile",", so your application can route on it.",[340,381,382,387,390],{},[358,383,384],{},[215,385,386],{},"From",[358,388,389],{},"zero, or a valid address",[358,391,392,393,396],{},"The fixed sender. Zero means every template of this profile must set frontmatter ",[215,394,395],{},"from"," instead.",[340,398,399,404,407],{},[358,400,401],{},[215,402,403],{},"FromDomain",[358,405,406],{},"a hostname, or empty",[358,408,409,410,412,413,415],{},"The domain a ",[215,411,395],{}," (frontmatter or the fixed ",[215,414,386],{},") must be on, compared case-insensitively.",[340,417,418,423,430],{},[358,419,420],{},[215,421,422],{},"Headers",[358,424,425,426,429],{},"each value must pass ",[215,427,428],{},"Message.SetHeader","'s rules",[358,431,432,433,436,437,286],{},"Added to every message the profile produces, e.g. ",[215,434,435],{},"X-SES-CONFIGURATION-SET",". See ",[438,439,441],"a",{"href":440},"\u002Fsending\u002Fmessage-and-mime#set-a-custom-header","Set a custom header",[340,443,444,449,452],{},[358,445,446],{},[215,447,448],{},"ListUnsubscribe",[358,450,451],{},"—",[358,453,454,455,458,459,462],{},"Sets the RFC 8058 one-click headers from the recipient's ",[215,456,457],{},"UnsubscribeURL",", which must then be an absolute ",[215,460,461],{},"https"," URL.",[211,464,465,466,470],{},"A profile carries no sending policy of its own — no stream, no suppression list. Routing and suppression are your application's job; see ",[438,467,469],{"href":468},"#route-on-messageprofile","Route on Message.Profile"," below.",[232,472,474],{"id":473},"choose-where-from-comes-from","Choose where From comes from",[211,476,477],{},"A profile either fixes its sender or takes it from the template:",[479,480,481,498],"ul",{},[482,483,484,488,489,491,492,494,495,286],"li",{},[485,486,487],"strong",{},"Fixed",": set ",[215,490,386],{},". Every template of the profile must then leave frontmatter ",[215,493,395],{}," out — setting it fails to render with ",[215,496,497],{},"frontmatter: \"from\" is not allowed: profile \"orders\" has a fixed From",[482,499,500,503,504,506,507,510,511,514,515,517,518,521,522,524,525,528],{},[485,501,502],{},"From the template",": leave ",[215,505,386],{}," zero. Every template of the profile must then set ",[215,508,509],{},"from:",", or render fails with ",[215,512,513],{},"frontmatter: profile \"b2b\" has no From, so \"from\" is required",". The evaluated address is parsed, checked against ",[215,516,403],{}," when one is set (",[215,519,520],{},"from \"x@elsewhere.com\" is not on partners.acme.example","), and checked with the same address rule a fixed ",[215,523,386],{}," gets: a valid ",[215,526,527],{},"local@domain"," address, and a name with no CR, LF or NUL.",[211,530,531,533,534,536,537,540,541,543],{},[215,532,403],{}," applies to either path: a fixed ",[215,535,386],{}," off its domain fails when the config is checked (",[215,538,539],{},"config: profile \"orders\": from \"orders@other.example\" is not on acme.example","); a frontmatter ",[215,542,395],{}," off it fails at render.",[232,545,547],{"id":546},"fill-the-config","Fill the config",[237,549,552],{"className":239,"code":550,"filename":551,"language":242,"meta":243,"style":243},"type Config struct {\n    Kit               *kit.Kit\n    Profiles          []Profile\n    AssetBase         string\n    Vars              map[string]string\n    AllowRelativeURLs bool\n}\n","config.go",[215,553,554,565,581,589,596,611,618],{"__ignoreMap":243},[247,555,556,558,561,563],{"class":249,"line":250},[247,557,254],{"class":253},[247,559,560],{"class":257}," Config",[247,562,261],{"class":253},[247,564,265],{"class":264},[247,566,567,570,573,576,578],{"class":249,"line":268},[247,568,569],{"class":264},"    Kit               ",[247,571,572],{"class":253},"*",[247,574,575],{"class":257},"kit",[247,577,286],{"class":264},[247,579,580],{"class":257},"Kit\n",[247,582,583,586],{"class":249,"line":277},[247,584,585],{"class":264},"    Profiles          []",[247,587,588],{"class":257},"Profile\n",[247,590,591,594],{"class":249,"line":292},[247,592,593],{"class":264},"    AssetBase         ",[247,595,274],{"class":253},[247,597,598,601,603,605,607,609],{"class":249,"line":300},[247,599,600],{"class":264},"    Vars              ",[247,602,306],{"class":253},[247,604,309],{"class":264},[247,606,312],{"class":253},[247,608,315],{"class":264},[247,610,274],{"class":253},[247,612,613,616],{"class":249,"line":320},[247,614,615],{"class":264},"    AllowRelativeURLs ",[247,617,326],{"class":253},[247,619,620],{"class":249,"line":329},[247,621,332],{"class":264},[334,623,624,635],{},[337,625,626],{},[340,627,628,630,632],{},[343,629,345],{},[343,631,348],{},[343,633,634],{},"Used for",[353,636,637,653,669,696,720],{},[340,638,639,644,647],{},[358,640,641],{},[215,642,643],{},"Kit",[358,645,646],{},"not nil",[358,648,649,650,286],{},"Every template must be compiled against this same ",[215,651,652],{},"*kit.Kit",[340,654,655,660,663],{},[358,656,657],{},[215,658,659],{},"Profiles",[358,661,662],{},"at least one; every name non-empty and unique",[358,664,665,666,668],{},"The sender profiles a template's frontmatter ",[215,667,374],{}," can name.",[340,670,671,676,690],{},[358,672,673],{},[215,674,675],{},"AssetBase",[358,677,678,679,681,682,685,686,689],{},"an absolute ",[215,680,461],{}," URL, or relative with ",[215,683,684],{},"AllowRelativeURLs","; empty keeps the kit's own ",[215,687,688],{},"asset_base"," default",[358,691,692,695],{},[215,693,694],{},"{{var \"asset_base\"}}"," in kit templates — the base URL logos and images resolve against.",[340,697,698,703,717],{},[358,699,700],{},[215,701,702],{},"Vars",[358,704,705,706,708,709,712,713,716],{},"keys must be kit vars other than ",[215,707,688],{},"; values must hold no ",[215,710,711],{},"\u003C",", ",[215,714,715],{},">"," or control character",[358,718,719],{},"Overrides the kit's own var defaults per renderer — the brand name, a footer address, and so on.",[340,721,722,726,728],{},[358,723,724],{},[215,725,684],{},[358,727,451],{},[358,729,730,731,733],{},"Lets a relative ",[215,732,675],{},", and relative URLs anywhere in a template, through. Previews only: a relative URL means nothing in an inbox.",[211,735,736,737,740],{},"There is no ",[215,738,739],{},"DefaultConfig",": every value is yours.",[232,742,744],{"id":743},"let-the-kit-set-the-asset-base","Let the kit set the asset base",[211,746,747,749,750,752,753,755],{},[215,748,675],{}," is where your logo and image files are served from. When you leave it empty, ",[215,751,225],{}," falls back to the kit's own ",[215,754,688],{}," var default — and that default must pass the same https rule. The Plain kit ships one:",[237,757,762],{"className":758,"code":759,"filename":760,"language":761,"meta":243,"style":243},"language-yaml shiki shiki-themes github-light-high-contrast github-light-high-contrast github-dark","vars:\n  brand: Example\n  site: https:\u002F\u002Fexample.com\n  company: Example Inc.\n  address: 100 Main Street, Springfield\n  asset_base: https:\u002F\u002Fexample.com\u002Fassets\n","plain\u002Fkit.yaml#L46-L51","yaml",[215,763,764,773,785,795,805,815],{"__ignoreMap":243},[247,765,766,770],{"class":249,"line":250},[247,767,769],{"class":768},"s71pN","vars",[247,771,772],{"class":264},":\n",[247,774,775,778,781],{"class":249,"line":268},[247,776,777],{"class":768},"  brand",[247,779,780],{"class":264},": ",[247,782,784],{"class":783},"sRBGO","Example\n",[247,786,787,790,792],{"class":249,"line":277},[247,788,789],{"class":768},"  site",[247,791,780],{"class":264},[247,793,794],{"class":783},"https:\u002F\u002Fexample.com\n",[247,796,797,800,802],{"class":249,"line":292},[247,798,799],{"class":768},"  company",[247,801,780],{"class":264},[247,803,804],{"class":783},"Example Inc.\n",[247,806,807,810,812],{"class":249,"line":300},[247,808,809],{"class":768},"  address",[247,811,780],{"class":264},[247,813,814],{"class":783},"100 Main Street, Springfield\n",[247,816,817,820,822],{"class":249,"line":320},[247,818,819],{"class":768},"  asset_base",[247,821,780],{"class":264},[247,823,824],{"class":783},"https:\u002F\u002Fexample.com\u002Fassets\n",[211,826,827,828,831,832,834,835,837,838,841,842,844,845,847,848,850,851,854],{},"so ",[215,829,830],{},"lttr.Config{Kit: plain.MustKit()}"," — no ",[215,833,675],{}," at all — renders with ",[215,836,694],{}," equal to ",[215,839,840],{},"https:\u002F\u002Fexample.com\u002Fassets",". A kit with no ",[215,843,688],{}," default, and a ",[215,846,221],{}," with no ",[215,849,675],{},", leaves the var empty: fine for a kit whose components never link an image. Setting ",[215,852,853],{},"Config.AssetBase"," always wins over the kit's default.",[232,856,858],{"id":857},"override-kit-vars-safely","Override kit vars, safely",[211,860,861,863,864,867,868,870,871,873,874,876],{},[215,862,702],{}," overrides the kit's own var defaults — everything under ",[215,865,866],{},"vars:"," in ",[215,869,79],{}," except ",[215,872,688],{},", which ",[215,875,675],{}," sets instead. Two things make a var override fail:",[479,878,879,897],{},[482,880,881,884,885,887,888,891,892,887,894,286],{},[485,882,883],{},"The name isn't the kit's."," A key the kit does not declare under ",[215,886,866],{}," is ",[215,889,890],{},"vars: unknown var \"x\"","; a key of ",[215,893,688],{},[215,895,896],{},"vars: \"asset_base\" is set with AssetBase",[482,898,899,902,903,712,905,907,908,911],{},[485,900,901],{},"The value has an unsafe character."," ",[215,904,711],{},[215,906,715],{},", or any control character (including DEL) fails with ",[215,909,910],{},"vars: \"brand\": unsafe character '\u003C'"," — vars are written straight into kit templates, so this is what stops a var value from injecting markup.",[232,913,915],{"id":914},"let-newrenderer-report-every-problem","Let NewRenderer report every problem",[237,917,920],{"className":239,"code":918,"filename":919,"language":242,"meta":243,"style":243},"func NewRenderer(cfg Config) (*Renderer, error)\n","renderer.go",[215,921,922],{"__ignoreMap":243},[247,923,924,927,931,934,938,940,943,945,948,950,953],{"class":249,"line":250},[247,925,926],{"class":253},"func",[247,928,930],{"class":929},"sPmw6"," NewRenderer",[247,932,933],{"class":264},"(",[247,935,937],{"class":936},"s-BBy","cfg",[247,939,560],{"class":257},[247,941,942],{"class":264},") (",[247,944,572],{"class":253},[247,946,947],{"class":257},"Renderer",[247,949,712],{"class":264},[247,951,952],{"class":253},"error",[247,954,955],{"class":264},")\n",[211,957,958,960],{},[215,959,225],{}," checks the whole config — every profile, the asset base, every var, and the kit's own templates against those vars — and joins every problem it finds, rather than stopping at the first. For this config:",[237,962,965],{"className":239,"code":963,"filename":964,"language":242,"meta":243,"style":243},"_, err := lttr.NewRenderer(lttr.Config{\n    Kit: plain.MustKit(),\n    Profiles: []lttr.Profile{\n        {Name: \"\", From: mail.Address{Name: \"No Address\"}},\n        {Name: \"orders\", From: mail.Address{Address: \"orders@acme.example\"}, FromDomain: \"not a hostname\"},\n        {Name: \"orders\", From: mail.Address{Address: \"orders@acme.example\"}},\n    },\n    AssetBase: \"not-https\",\n    Vars:      map[string]string{\"nope\": \"x\", \"brand\": \"Ac\u003Cme\"},\n})\n","main.go",[215,966,967,992,1003,1016,1043,1073,1093,1098,1110,1149],{"__ignoreMap":243},[247,968,969,972,975,978,980,982,985,987,989],{"class":249,"line":250},[247,970,971],{"class":264},"_, err ",[247,973,974],{"class":253},":=",[247,976,977],{"class":264}," lttr.",[247,979,225],{"class":929},[247,981,933],{"class":264},[247,983,984],{"class":257},"lttr",[247,986,286],{"class":264},[247,988,221],{"class":257},[247,990,991],{"class":264},"{\n",[247,993,994,997,1000],{"class":249,"line":268},[247,995,996],{"class":264},"    Kit: plain.",[247,998,999],{"class":929},"MustKit",[247,1001,1002],{"class":264},"(),\n",[247,1004,1005,1008,1010,1012,1014],{"class":249,"line":277},[247,1006,1007],{"class":264},"    Profiles: []",[247,1009,984],{"class":257},[247,1011,286],{"class":264},[247,1013,217],{"class":257},[247,1015,991],{"class":264},[247,1017,1018,1021,1024,1027,1029,1031,1034,1037,1040],{"class":249,"line":292},[247,1019,1020],{"class":264},"        {Name: ",[247,1022,1023],{"class":783},"\"\"",[247,1025,1026],{"class":264},", From: ",[247,1028,283],{"class":257},[247,1030,286],{"class":264},[247,1032,1033],{"class":257},"Address",[247,1035,1036],{"class":264},"{Name: ",[247,1038,1039],{"class":783},"\"No Address\"",[247,1041,1042],{"class":264},"}},\n",[247,1044,1045,1047,1050,1052,1054,1056,1058,1061,1064,1067,1070],{"class":249,"line":300},[247,1046,1020],{"class":264},[247,1048,1049],{"class":783},"\"orders\"",[247,1051,1026],{"class":264},[247,1053,283],{"class":257},[247,1055,286],{"class":264},[247,1057,1033],{"class":257},[247,1059,1060],{"class":264},"{Address: ",[247,1062,1063],{"class":783},"\"orders@acme.example\"",[247,1065,1066],{"class":264},"}, FromDomain: ",[247,1068,1069],{"class":783},"\"not a hostname\"",[247,1071,1072],{"class":264},"},\n",[247,1074,1075,1077,1079,1081,1083,1085,1087,1089,1091],{"class":249,"line":320},[247,1076,1020],{"class":264},[247,1078,1049],{"class":783},[247,1080,1026],{"class":264},[247,1082,283],{"class":257},[247,1084,286],{"class":264},[247,1086,1033],{"class":257},[247,1088,1060],{"class":264},[247,1090,1063],{"class":783},[247,1092,1042],{"class":264},[247,1094,1095],{"class":249,"line":329},[247,1096,1097],{"class":264},"    },\n",[247,1099,1101,1104,1107],{"class":249,"line":1100},8,[247,1102,1103],{"class":264},"    AssetBase: ",[247,1105,1106],{"class":783},"\"not-https\"",[247,1108,1109],{"class":264},",\n",[247,1111,1113,1116,1118,1120,1122,1124,1126,1129,1132,1134,1137,1139,1142,1144,1147],{"class":249,"line":1112},9,[247,1114,1115],{"class":264},"    Vars:      ",[247,1117,306],{"class":253},[247,1119,309],{"class":264},[247,1121,312],{"class":253},[247,1123,315],{"class":264},[247,1125,312],{"class":253},[247,1127,1128],{"class":264},"{",[247,1130,1131],{"class":783},"\"nope\"",[247,1133,780],{"class":264},[247,1135,1136],{"class":783},"\"x\"",[247,1138,712],{"class":264},[247,1140,1141],{"class":783},"\"brand\"",[247,1143,780],{"class":264},[247,1145,1146],{"class":783},"\"Ac\u003Cme\"",[247,1148,1072],{"class":264},[247,1150,1152],{"class":249,"line":1151},10,[247,1153,1154],{"class":264},"})\n",[237,1156,1162],{"className":1157,"code":1159,"filename":1160,"language":1161,"meta":243},[1158],"language-text","config: Profiles[0] has no name\nconfig: profile \"\": from has a name but no address\nconfig: profile \"orders\": FromDomain \"not a hostname\" is not a hostname\nconfig: profile \"orders\" is defined twice\nvars: \"brand\": unsafe character '\u003C'\nvars: unknown var \"nope\"\nconfig: AssetBase \"not-https\" must be an absolute https URL\n","Error","text",[215,1163,1159],{"__ignoreMap":243},[211,1165,1166,1167,712,1170,1173,1174,867,1177,1179],{},"(captured from a real run against this checkout). Every profile-specific error names the profile (",[215,1168,1169],{},"profile \"orders\"",[215,1171,1172],{},"Profiles[0]","), so it's easy to trace back to the ",[215,1175,1176],{},"lttr.Profile{...}",[215,1178,368],{}," that caused it.",[211,1181,1182,1183,1185],{},"A ",[215,1184,229],{}," is immutable and safe for concurrent use; it keeps its own copy of every profile. Build one at start-up and share it.",[237,1187,1189],{"className":239,"code":1188,"filename":919,"language":242,"meta":243,"style":243},"func (r *Renderer) Kit() *kit.Kit\nfunc (r *Renderer) Profile(name string) (Profile, bool)\nfunc (r *Renderer) Profiles() []Profile\n",[215,1190,1191,1221,1256],{"__ignoreMap":243},[247,1192,1193,1195,1198,1201,1203,1205,1208,1210,1213,1215,1217,1219],{"class":249,"line":250},[247,1194,926],{"class":253},[247,1196,1197],{"class":264}," (",[247,1199,1200],{"class":936},"r ",[247,1202,572],{"class":253},[247,1204,947],{"class":257},[247,1206,1207],{"class":264},") ",[247,1209,643],{"class":929},[247,1211,1212],{"class":264},"() ",[247,1214,572],{"class":253},[247,1216,575],{"class":257},[247,1218,286],{"class":264},[247,1220,580],{"class":257},[247,1222,1223,1225,1227,1229,1231,1233,1235,1237,1239,1242,1245,1247,1249,1251,1254],{"class":249,"line":268},[247,1224,926],{"class":253},[247,1226,1197],{"class":264},[247,1228,1200],{"class":936},[247,1230,572],{"class":253},[247,1232,947],{"class":257},[247,1234,1207],{"class":264},[247,1236,217],{"class":929},[247,1238,933],{"class":264},[247,1240,1241],{"class":936},"name",[247,1243,1244],{"class":253}," string",[247,1246,942],{"class":264},[247,1248,217],{"class":257},[247,1250,712],{"class":264},[247,1252,1253],{"class":253},"bool",[247,1255,955],{"class":264},[247,1257,1258,1260,1262,1264,1266,1268,1270,1272,1275],{"class":249,"line":277},[247,1259,926],{"class":253},[247,1261,1197],{"class":264},[247,1263,1200],{"class":936},[247,1265,572],{"class":253},[247,1267,947],{"class":257},[247,1269,1207],{"class":264},[247,1271,659],{"class":929},[247,1273,1274],{"class":264},"() []",[247,1276,588],{"class":257},[211,1278,1279,1281,1282,1284],{},[215,1280,217],{}," and ",[215,1283,659],{}," return copies — changing one never changes the renderer's own.",[232,1286,469],{"id":1287},"route-on-messageprofile",[211,1289,1290,1291,1293,1294,1297,1298,1301,1302,1305],{},"lttr does no routing of its own: ",[215,1292,378],{}," is the profile name ",[215,1295,1296],{},"Render"," copied from the template's frontmatter, and routing which ",[215,1299,1300],{},"Sender"," a message goes through is entirely your application's decision — a plain ",[215,1303,1304],{},"switch",", a map lookup, or whatever your service already uses for that kind of choice.",[237,1307,1309],{"className":239,"code":1308,"filename":964,"language":242,"meta":243,"style":243},"package main\n\nimport (\n    \"context\"\n    \"fmt\"\n\n    \"github.com\u002Fsulv-io\u002Flttr\"\n)\n\n\u002F\u002F send routes m to a Sender by the profile its template named: transactional\n\u002F\u002F profiles share one sender, marketing profiles (which set ListUnsubscribe)\n\u002F\u002F share another, and internal mail goes through a third.\nfunc send(ctx context.Context, senders map[string]lttr.Sender, m *lttr.Message) error {\n    switch m.Profile {\n    case \"buyer\", \"seller\", \"driver\", \"security\":\n        return senders[\"transactional\"].Send(ctx, m)\n    case \"announcement\", \"newsletter\", \"promo\":\n        return senders[\"marketing\"].Send(ctx, m)\n    case \"internal\":\n        return senders[\"internal\"].Send(ctx, m)\n    default:\n        return fmt.Errorf(\"no sender for profile %q\", m.Profile)\n    }\n}\n\nfunc main() {}\n",[215,1310,1311,1319,1325,1333,1344,1353,1357,1366,1370,1374,1380,1386,1392,1454,1463,1489,1510,1530,1546,1556,1572,1580,1606,1612,1617,1622],{"__ignoreMap":243},[247,1312,1313,1316],{"class":249,"line":250},[247,1314,1315],{"class":253},"package",[247,1317,1318],{"class":257}," main\n",[247,1320,1321],{"class":249,"line":268},[247,1322,1324],{"emptyLinePlaceholder":1323},true,"\n",[247,1326,1327,1330],{"class":249,"line":277},[247,1328,1329],{"class":253},"import",[247,1331,1332],{"class":264}," (\n",[247,1334,1335,1338,1341],{"class":249,"line":292},[247,1336,1337],{"class":783},"    \"",[247,1339,1340],{"class":257},"context",[247,1342,1343],{"class":783},"\"\n",[247,1345,1346,1348,1351],{"class":249,"line":300},[247,1347,1337],{"class":783},[247,1349,1350],{"class":257},"fmt",[247,1352,1343],{"class":783},[247,1354,1355],{"class":249,"line":320},[247,1356,1324],{"emptyLinePlaceholder":1323},[247,1358,1359,1361,1364],{"class":249,"line":329},[247,1360,1337],{"class":783},[247,1362,1363],{"class":257},"github.com\u002Fsulv-io\u002Flttr",[247,1365,1343],{"class":783},[247,1367,1368],{"class":249,"line":1100},[247,1369,955],{"class":264},[247,1371,1372],{"class":249,"line":1112},[247,1373,1324],{"emptyLinePlaceholder":1323},[247,1375,1376],{"class":249,"line":1151},[247,1377,1379],{"class":1378},"sBq4M","\u002F\u002F send routes m to a Sender by the profile its template named: transactional\n",[247,1381,1383],{"class":249,"line":1382},11,[247,1384,1385],{"class":1378},"\u002F\u002F profiles share one sender, marketing profiles (which set ListUnsubscribe)\n",[247,1387,1389],{"class":249,"line":1388},12,[247,1390,1391],{"class":1378},"\u002F\u002F share another, and internal mail goes through a third.\n",[247,1393,1395,1397,1400,1402,1405,1408,1410,1413,1415,1418,1421,1423,1425,1427,1429,1431,1433,1435,1438,1441,1443,1445,1448,1450,1452],{"class":249,"line":1394},13,[247,1396,926],{"class":253},[247,1398,1399],{"class":929}," send",[247,1401,933],{"class":264},[247,1403,1404],{"class":936},"ctx",[247,1406,1407],{"class":257}," context",[247,1409,286],{"class":264},[247,1411,1412],{"class":257},"Context",[247,1414,712],{"class":264},[247,1416,1417],{"class":936},"senders",[247,1419,1420],{"class":253}," map",[247,1422,309],{"class":264},[247,1424,312],{"class":253},[247,1426,315],{"class":264},[247,1428,984],{"class":257},[247,1430,286],{"class":264},[247,1432,1300],{"class":257},[247,1434,712],{"class":264},[247,1436,1437],{"class":936},"m",[247,1439,1440],{"class":253}," *",[247,1442,984],{"class":257},[247,1444,286],{"class":264},[247,1446,1447],{"class":257},"Message",[247,1449,1207],{"class":264},[247,1451,952],{"class":253},[247,1453,265],{"class":264},[247,1455,1457,1460],{"class":249,"line":1456},14,[247,1458,1459],{"class":253},"    switch",[247,1461,1462],{"class":264}," m.Profile {\n",[247,1464,1466,1469,1472,1474,1477,1479,1482,1484,1487],{"class":249,"line":1465},15,[247,1467,1468],{"class":253},"    case",[247,1470,1471],{"class":783}," \"buyer\"",[247,1473,712],{"class":264},[247,1475,1476],{"class":783},"\"seller\"",[247,1478,712],{"class":264},[247,1480,1481],{"class":783},"\"driver\"",[247,1483,712],{"class":264},[247,1485,1486],{"class":783},"\"security\"",[247,1488,772],{"class":264},[247,1490,1492,1495,1498,1501,1504,1507],{"class":249,"line":1491},16,[247,1493,1494],{"class":253},"        return",[247,1496,1497],{"class":264}," senders[",[247,1499,1500],{"class":783},"\"transactional\"",[247,1502,1503],{"class":264},"].",[247,1505,1506],{"class":929},"Send",[247,1508,1509],{"class":264},"(ctx, m)\n",[247,1511,1513,1515,1518,1520,1523,1525,1528],{"class":249,"line":1512},17,[247,1514,1468],{"class":253},[247,1516,1517],{"class":783}," \"announcement\"",[247,1519,712],{"class":264},[247,1521,1522],{"class":783},"\"newsletter\"",[247,1524,712],{"class":264},[247,1526,1527],{"class":783},"\"promo\"",[247,1529,772],{"class":264},[247,1531,1533,1535,1537,1540,1542,1544],{"class":249,"line":1532},18,[247,1534,1494],{"class":253},[247,1536,1497],{"class":264},[247,1538,1539],{"class":783},"\"marketing\"",[247,1541,1503],{"class":264},[247,1543,1506],{"class":929},[247,1545,1509],{"class":264},[247,1547,1549,1551,1554],{"class":249,"line":1548},19,[247,1550,1468],{"class":253},[247,1552,1553],{"class":783}," \"internal\"",[247,1555,772],{"class":264},[247,1557,1559,1561,1563,1566,1568,1570],{"class":249,"line":1558},20,[247,1560,1494],{"class":253},[247,1562,1497],{"class":264},[247,1564,1565],{"class":783},"\"internal\"",[247,1567,1503],{"class":264},[247,1569,1506],{"class":929},[247,1571,1509],{"class":264},[247,1573,1575,1578],{"class":249,"line":1574},21,[247,1576,1577],{"class":253},"    default",[247,1579,772],{"class":264},[247,1581,1583,1585,1588,1591,1593,1596,1600,1603],{"class":249,"line":1582},22,[247,1584,1494],{"class":253},[247,1586,1587],{"class":264}," fmt.",[247,1589,1590],{"class":929},"Errorf",[247,1592,933],{"class":264},[247,1594,1595],{"class":783},"\"no sender for profile ",[247,1597,1599],{"class":1598},"sFaxo","%q",[247,1601,1602],{"class":783},"\"",[247,1604,1605],{"class":264},", m.Profile)\n",[247,1607,1609],{"class":249,"line":1608},23,[247,1610,1611],{"class":264},"    }\n",[247,1613,1615],{"class":249,"line":1614},24,[247,1616,332],{"class":264},[247,1618,1620],{"class":249,"line":1619},25,[247,1621,1324],{"emptyLinePlaceholder":1323},[247,1623,1625,1627,1630],{"class":249,"line":1624},26,[247,1626,926],{"class":253},[247,1628,1629],{"class":929}," main",[247,1631,1632],{"class":264},"() {}\n",[211,1634,1635,1637],{},[215,1636,1300],{}," is one method, so a suppression check or an internal-recipient allow-list is just a wrapper around it:",[237,1639,1641],{"className":239,"code":1640,"filename":964,"language":242,"meta":243,"style":243},"\u002F\u002F suppressing skips a send when m.Profile is on the suppression list for m.To.\ntype suppressing struct {\n    next         lttr.Sender\n    isSuppressed func(profile, addr string) bool\n}\n\nfunc (s suppressing) Send(ctx context.Context, m *lttr.Message) error {\n    if s.isSuppressed(m.Profile, m.To.Address) {\n        return fmt.Errorf(\"%s: recipient suppressed for %q\", m.To.Address, m.Profile)\n    }\n    return s.next.Send(ctx, m)\n}\n",[215,1642,1643,1648,1659,1671,1694,1698,1702,1746,1760,1785,1789,1801],{"__ignoreMap":243},[247,1644,1645],{"class":249,"line":250},[247,1646,1647],{"class":1378},"\u002F\u002F suppressing skips a send when m.Profile is on the suppression list for m.To.\n",[247,1649,1650,1652,1655,1657],{"class":249,"line":268},[247,1651,254],{"class":253},[247,1653,1654],{"class":257}," suppressing",[247,1656,261],{"class":253},[247,1658,265],{"class":264},[247,1660,1661,1664,1666,1668],{"class":249,"line":277},[247,1662,1663],{"class":264},"    next         ",[247,1665,984],{"class":257},[247,1667,286],{"class":264},[247,1669,1670],{"class":257},"Sender\n",[247,1672,1673,1676,1678,1680,1683,1685,1688,1690,1692],{"class":249,"line":292},[247,1674,1675],{"class":264},"    isSuppressed ",[247,1677,926],{"class":253},[247,1679,933],{"class":264},[247,1681,1682],{"class":936},"profile",[247,1684,712],{"class":264},[247,1686,1687],{"class":936},"addr",[247,1689,1244],{"class":253},[247,1691,1207],{"class":264},[247,1693,326],{"class":253},[247,1695,1696],{"class":249,"line":300},[247,1697,332],{"class":264},[247,1699,1700],{"class":249,"line":320},[247,1701,1324],{"emptyLinePlaceholder":1323},[247,1703,1704,1706,1708,1711,1714,1716,1718,1720,1722,1724,1726,1728,1730,1732,1734,1736,1738,1740,1742,1744],{"class":249,"line":329},[247,1705,926],{"class":253},[247,1707,1197],{"class":264},[247,1709,1710],{"class":936},"s ",[247,1712,1713],{"class":257},"suppressing",[247,1715,1207],{"class":264},[247,1717,1506],{"class":929},[247,1719,933],{"class":264},[247,1721,1404],{"class":936},[247,1723,1407],{"class":257},[247,1725,286],{"class":264},[247,1727,1412],{"class":257},[247,1729,712],{"class":264},[247,1731,1437],{"class":936},[247,1733,1440],{"class":253},[247,1735,984],{"class":257},[247,1737,286],{"class":264},[247,1739,1447],{"class":257},[247,1741,1207],{"class":264},[247,1743,952],{"class":253},[247,1745,265],{"class":264},[247,1747,1748,1751,1754,1757],{"class":249,"line":1100},[247,1749,1750],{"class":253},"    if",[247,1752,1753],{"class":264}," s.",[247,1755,1756],{"class":929},"isSuppressed",[247,1758,1759],{"class":264},"(m.Profile, m.To.Address) {\n",[247,1761,1762,1764,1766,1768,1770,1772,1775,1778,1780,1782],{"class":249,"line":1112},[247,1763,1494],{"class":253},[247,1765,1587],{"class":264},[247,1767,1590],{"class":929},[247,1769,933],{"class":264},[247,1771,1602],{"class":783},[247,1773,1774],{"class":1598},"%s",[247,1776,1777],{"class":783},": recipient suppressed for ",[247,1779,1599],{"class":1598},[247,1781,1602],{"class":783},[247,1783,1784],{"class":264},", m.To.Address, m.Profile)\n",[247,1786,1787],{"class":249,"line":1151},[247,1788,1611],{"class":264},[247,1790,1791,1794,1797,1799],{"class":249,"line":1382},[247,1792,1793],{"class":253},"    return",[247,1795,1796],{"class":264}," s.next.",[247,1798,1506],{"class":929},[247,1800,1509],{"class":264},[247,1802,1803],{"class":249,"line":1388},[247,1804,332],{"class":264},[211,1806,1807,1808,1810,1811,1813,1814,1816,1817,286],{},"See ",[438,1809,128],{"href":129}," for the one ",[215,1812,1300],{}," lttr ships, and ",[438,1815,123],{"href":124}," for everything else on ",[215,1818,1819],{},"*Message",[232,1821,1823],{"id":1822},"next-steps","Next steps",[479,1825,1826,1834,1839],{},[482,1827,1828,1830,1831,1833],{},[438,1829,123],{"href":124}," for the rest of ",[215,1832,1819],{},", custom headers and the size limit.",[482,1835,1836,1838],{},[438,1837,128],{"href":129}," for delivering the message.",[482,1840,1841,1843,1844,1847,1848,286],{},[438,1842,139],{"href":140}," for ",[215,1845,1846],{},"-kit",", the flag every command shares with ",[215,1849,1850],{},"Config.Kit",[1852,1853,1854],"style",{},"html pre.shiki code .s1Q0q, html code.shiki .s1Q0q{--shiki-light:#A0111F;--shiki-default:#A0111F;--shiki-dark:#F97583}html pre.shiki code .sSlKG, html code.shiki .sSlKG{--shiki-light:#702C00;--shiki-default:#702C00;--shiki-dark:#B392F0}html pre.shiki code .sihDN, html code.shiki .sihDN{--shiki-light:#0E1116;--shiki-default:#0E1116;--shiki-dark:#E1E4E8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s71pN, html code.shiki .s71pN{--shiki-light:#024C1A;--shiki-default:#024C1A;--shiki-dark:#85E89D}html pre.shiki code .sRBGO, html code.shiki .sRBGO{--shiki-light:#032563;--shiki-default:#032563;--shiki-dark:#9ECBFF}html pre.shiki code .sPmw6, html code.shiki .sPmw6{--shiki-light:#622CBC;--shiki-default:#622CBC;--shiki-dark:#B392F0}html pre.shiki code .s-BBy, html code.shiki .s-BBy{--shiki-light:#702C00;--shiki-default:#702C00;--shiki-dark:#FFAB70}html pre.shiki code .sBq4M, html code.shiki .sBq4M{--shiki-light:#66707B;--shiki-default:#66707B;--shiki-dark:#6A737D}html pre.shiki code .sFaxo, html code.shiki .sFaxo{--shiki-light:#A0111F;--shiki-default:#A0111F;--shiki-dark:#79B8FF}",{"title":243,"searchDepth":268,"depth":268,"links":1856},[1857,1858,1859,1860,1861,1862,1863,1864],{"id":234,"depth":268,"text":235},{"id":473,"depth":268,"text":474},{"id":546,"depth":268,"text":547},{"id":743,"depth":268,"text":744},{"id":857,"depth":268,"text":858},{"id":914,"depth":268,"text":915},{"id":1287,"depth":268,"text":469},{"id":1822,"depth":268,"text":1823},"Define sender profiles, fill a Config, and let NewRenderer check everything at once — then route a rendered Message yourself.","md",null,{},{"icon":121},{"title":118,"description":1865},"IGG0vi6a6jK9ujjeAVl7Mm_iP2n1qhiHCiclL6c9MEY",[1873,1875],{"title":107,"path":108,"stem":109,"description":1874,"icon":110,"children":-1},"How a kit writes the plain-text part — text templates, the core block forms and blocks.txt, separators, the wrapping and table helpers, and how the parts are joined.",{"title":123,"path":124,"stem":125,"description":1876,"icon":126,"children":-1},"The rendered email as a Go value, the rules for adding your own headers, the exact bytes MIME writes, and the size limit Render enforces.",1790467458233]