{"id":18195,"library":"castle-email-lib","title":"Castle Email Library","description":"A library for building emails with React, version 2.5.0. Provides components and utilities to create responsive, template-based emails using React, simplifying the process of generating HTML emails. It emphasizes a component-based approach, allowing reuse and composition, and integrates with common email sending services. Key differentiators include a focus on React developers familiar with JSX, reducing the need for traditional email template languages. Currently stable with regular updates.","status":"active","version":"2.5.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install castle-email-lib","lang":"bash","label":"npm"},{"cmd":"yarn add castle-email-lib","lang":"bash","label":"yarn"},{"cmd":"pnpm add castle-email-lib","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for rendering components","package":"react","optional":false}],"imports":[{"note":"ESM only; CJS not supported","wrong":"const { CastleEmail } = require('castle-email-lib')","symbol":"CastleEmail","correct":"import { CastleEmail } from 'castle-email-lib'"},{"note":"Export from subpath; default export is not available.","wrong":"import EmailRenderer from 'castle-email-lib'","symbol":"EmailRenderer","correct":"import { EmailRenderer } from 'castle-email-lib/renderer'"},{"note":"Named export only.","wrong":"import Template from 'castle-email-lib/templates'","symbol":"Template","correct":"import { Template } from 'castle-email-lib/templates'"}],"quickstart":{"code":"import { CastleEmail, EmailRenderer } from 'castle-email-lib';\nimport React from 'react';\n\nconst MyEmail = () => (\n  <CastleEmail>\n    <h1>Hello World</h1>\n  </CastleEmail>\n);\n\nconst renderer = new EmailRenderer();\nconst html = renderer.render(<MyEmail />);\nconsole.log(html);","lang":"typescript","description":"Shows basic usage of CastleEmail component and EmailRenderer to generate email HTML."},"warnings":[{"fix":"Update imports: `import { CastleEmail } from 'castle-email-lib'` and subpath imports for additional exports.","message":"Version 2.0.0 changed the import paths from root to subpaths.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use named imports instead.","message":"The default export was removed in v2.0.0.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Always pass a React element, e.g., `renderer.render(<MyComponent />)`.","message":"EmailRenderer expects JSX element, not component class or string.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ESM imports or upgrade build system.","message":"CJS support dropped in v2.0.0, only ESM is supported.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.5.0':12 'allow':40 'approach':39 'base':22,38 'build':7 'castl':1 'common':47 'compon':14,37 'component-bas':36 'composit':43 'creat':18 'current':70 'develop':58 'differenti':52 'email':2,8,23,32,48,67 'emphas':34 'familiar':59 'focus':55 'generat':30 'html':31 'includ':53 'integr':45 'javascript':75 'jsx':61 'key':51 'languag':69 'librari':3,5 'need':64 'process':28 'provid':13 'react':10,25,57 'reduc':62 'regular':73 'respons':19 'reus':41 'send':49 'servic':50 'simplifi':26 'stabl':71 'templat':21,68 'template-bas':20 'tradit':66 'updat':74 'use':24 'util':16 'version':11","created_at":"2026-04-25T07:36:57.818295+00:00","updated_at":"2026-04-25T07:36:57.818295+00:00","problems":[{"fix":"Run `npm install castle-email-lib` and use correct import: `import { CastleEmail } from 'castle-email-lib'`.","cause":"Missing package install or incorrect import path.","error":"Module not found: Can't resolve 'castle-email-lib'"},{"fix":"Use named import: `import { CastleEmail } from 'castle-email-lib'`.","cause":"Using default import for non-default export.","error":"Uncaught TypeError: castle_email_lib_1.CastleEmail is not a constructor"},{"fix":"Ensure React is installed and import CastleEmail correctly.","cause":"Undefined symbol in scope, likely due to import error or missing peer dependency.","error":"CastleEmail is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/castle-email-lib","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}