Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Attach Files to custom notifications #1178

Closed
zottelmann opened this issue Dec 6, 2023 · 2 comments
Closed

[Feature] Attach Files to custom notifications #1178

zottelmann opened this issue Dec 6, 2023 · 2 comments
Assignees
Milestone

Comments

@zottelmann
Copy link

Hello!

As discussed here: https://typo3.slack.com/archives/C83T6DEKY/p1701872964848549

It seems not to be possible to attach files to custom notifications. Please make it possible :)

Regards
Timo

derhansen added a commit that referenced this issue Dec 6, 2023
The ModifyUserMessageAttachmentsEvent event has been extended
with the $customNotification property. This can be used to
add attachments to email sent using the backend module.

Refs #1178
derhansen added a commit that referenced this issue Dec 6, 2023
The existing possibility to add attachment to emails sent using the
extension has been extended, so attachments configured in TypoScript
now also can be applied to custom notifications. The configuration
options are the same as for emails sent by the registration process.

Example:

```
customNotifications {
    thanksForParticipation {
        title = Thank you message
        template = ThanksForParticipation.html
        subject = Thank you for participation in event "{event.title}"
        attachments {
          user {
            fromFiles {
              1 = fileadmin/test.pdf
            }
            fromEventProperty {
              1 = files
              2 = image
            }
            iCalFile = 1
          }
        }
    }
}
```

Refs #1178
@derhansen derhansen added this to the 7.4.0 milestone Dec 6, 2023
@derhansen derhansen self-assigned this Dec 6, 2023
@derhansen
Copy link
Owner

In current main development branch, I extended the ModifyUserMessageAttachmentsEvent PSR-14 event, so it can also be used for custom notifications.

Additionally I added a new feature, which enables support for attachments configured in TypoScript. It used the same configuration as the existing implementation.

Example:

customNotifications {
    thanksForParticipation {
        title = Thank you message
        template = ThanksForParticipation.html
        subject = Thank you for participation in event "{event.title}"
        attachments {
          user {
            fromFiles {
              1 = fileadmin/test.pdf
            }
            fromEventProperty {
              1 = files
              2 = image
            }
            iCalFile = 1
          }
        }
    }
}

So basically you can add attachments from a directory, event properties, registration properties or the iCal file for the event.

Both changes will be included in the next version of the extension.

@zottelmann
Copy link
Author

You are awesome :) Thanks!

derhansen added a commit that referenced this issue Dec 7, 2023
The ModifyUserMessageAttachmentsEvent event has been extended
with the $customNotification property. This can be used to
add attachments to email sent using the backend module.

Refs #1178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants