firstly 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # firstly
2
2
 
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#265](https://github.com/jycouet/firstly/pull/265) [`9105a8b`](https://github.com/jycouet/firstly/commit/9105a8b4ee47121fdfd8c33419c43bfa75f75c5c) Thanks [@jycouet](https://github.com/jycouet)! - mail: store `attachments` count in `Mail.metadata` so the admin UI can show how many files were sent.
8
+
3
9
  ## 0.4.2
4
10
 
5
11
  ### Patch Changes
@@ -71,6 +71,8 @@ export const sendMail = async (topic, easyOptions, options) => {
71
71
  secondaryColor = secondaryColor ?? '#653eae';
72
72
  title = title ?? subject ?? 'subject';
73
73
  footer = footer ?? 'The team wishes you a great day 🚀';
74
+ const mergedAttachments = options?.nodemailer?.defaults?.attachments ?? globalOptions?.nodemailer?.defaults?.attachments;
75
+ const attachments = Array.isArray(mergedAttachments) ? mergedAttachments.length : 0;
74
76
  const metadata = {
75
77
  service,
76
78
  primaryColor,
@@ -81,6 +83,7 @@ export const sendMail = async (topic, easyOptions, options) => {
81
83
  sections,
82
84
  cc,
83
85
  bcc,
86
+ attachments,
84
87
  };
85
88
  const html = easyOptionsToUse.toHtml ? easyOptionsToUse.toHtml(metadata) : toHtml(metadata);
86
89
  nodemailerOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firstly",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "description": "Firstly, an opinionated Remult setup!",
6
6
  "funding": "https://github.com/sponsors/jycouet",