diff --git a/.github/cherry-pick-bot.yml b/.github/cherry-pick-bot.yml deleted file mode 100644 index d4ca941..0000000 --- a/.github/cherry-pick-bot.yml +++ /dev/null @@ -1 +0,0 @@ -enabled: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 6d0a12e..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build extension -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - build: - uses: FriendsOfShopware/actions/.github/workflows/store-shopware-cli.yml@main - with: - extensionName: ${{ github.event.repository.name }} - secrets: - accountUser: ${{ secrets.ACCOUNT_USER }} - accountPassword: ${{ secrets.ACCOUNT_PASSWORD }} - ghToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/check-snippets.yml b/.github/workflows/check-snippets.yml deleted file mode 100644 index 41ffc2e..0000000 --- a/.github/workflows/check-snippets.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: CheckSnippets -on: - push: - branches: - - main - paths: - - 'src/**/snippet/*.json' - pull_request: - paths: - - 'src/**/snippet/*.json' - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '14' - - run: npm install -g compare-json - - run: comparejson -e -s="/" ./src/**/snippet/*.json diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml deleted file mode 100644 index 2182132..0000000 --- a/.github/workflows/code-style.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Code Style -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -jobs: - cs: - if: github.event_name != 'schedule' - uses: shopware/github-actions/.github/workflows/cs-fixer.yml@main - phpstan: - uses: shopware/github-actions/.github/workflows/phpstan.yml@main - with: - extensionName: FroshTools - shopwareVersion: v6.6.0.0-rc1 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6c6e0ce..0000000 --- a/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/.settings/ -/.buildpath -/.project -frosh-platform-mail-archive.css -frosh-platform-mail-archive.js -/vendor/ -/src/Resources/public/ -/composer.lock -.php-cs-fixer.cache \ No newline at end of file diff --git a/.shopware-extension.yml b/.shopware-extension.yml deleted file mode 100755 index d851d4a..0000000 --- a/.shopware-extension.yml +++ /dev/null @@ -1,76 +0,0 @@ -store: - availabilities: - - German - - International - default_locale: en_GB - localizations: - - de_DE - - en_GB - categories: - - BackendBearbeitung - type: extension - icon: src/Resources/store/icon.png - automatic_bugfix_version_compatibility: true - description: - de: | -

Mit diesem Plugin erhalten Sie ein einfaches durchsuchbares Archiv für E-Mails, die aus Shopware versendet werden.
- Die E-Mails sind über den Menüpfad erreichbar: Einstellungen/Erweiterungen/Main Archiv.

-

Dieses Plugin wird von @FriendsOfShopware - entwickelt.
- Maintainer dieses Plugins ist: Soner Sayakci

-

Bei Fragen / Fehlern bitte ein Github Issue erstellen

- en: | -

With this plugin you get a simple searchable archive for emails that are sent from Shopware.
- The e-mails can be found via the menu path Settings/Extensions/Main Archive.

-

This plugin is part of @FriendsOfShopware.
- Maintainer from the plugin is: Soner Sayakci

-

For questions or bugs please create a Github Issue

- installation_manual: - de: "" - en: "" - tags: - de: - - mail - - archive - en: - - mail - - archive - features: - de: - - Übersicht der versendenten E-Mails - - Durchsuchbares Archiv - - Erneutes versenden von E-Mails - - Automatisches entfernen alter E-Mails - - E-Mails, die nicht versendet werden konnten, werden markiert (ab 2.0.5) - en: - - Overview of sent emails - - Searchable archive - - Resend emails - - Automatically remove old emails - - Emails that could not be sent are marked as failed (from 2.0.5) - images: - - file: src/Resources/store/img-0.png - activate: - de: true - en: true - preview: - de: true - en: true - priority: 0 - - file: src/Resources/store/img-1.png - activate: - de: true - en: true - preview: - de: false - en: false - priority: 0 -build: - zip: - assets: - enabled: true - enable_es_build_for_admin: true - enable_es_build_for_storefront: true - -changelog: - enabled: true diff --git a/CHANGELOG_en-GB.md b/CHANGELOG_en-GB.md new file mode 100755 index 0000000..ceb64d1 --- /dev/null +++ b/CHANGELOG_en-GB.md @@ -0,0 +1,6 @@ +# 3.2.0 +- [chore: prepare release 3.2.0](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/commit/ad980a1) +- [feat: support compression with zstd (#99)](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/commit/4afee60) +- [fix: Attachments show up correctly again now (#92)](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/commit/dec77b6) +- [feat: save eml into subfolders (#96)](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/commit/befcf0f) +- [Cherry pick PR89 and PR91 (#95)](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/commit/b1f6fe1) \ No newline at end of file diff --git a/src/Resources/public/administration/css/frosh-platform-mail-archive.css b/src/Resources/public/administration/css/frosh-platform-mail-archive.css new file mode 100755 index 0000000..e056a28 --- /dev/null +++ b/src/Resources/public/administration/css/frosh-platform-mail-archive.css @@ -0,0 +1 @@ +.sw-sidebar-item__scrollable-container{padding:10px}.frosh-mail-archive__data-grid-danger-icon{margin-left:10px;color:red}.frosh-mail-archive-detail iframe{width:100%;height:500px;background-color:#fff}.frosh-mail-archive-detail pre{white-space:pre-line}.frosh-mail-archive__detail-alert{max-width:960px} diff --git a/src/Resources/public/administration/js/frosh-platform-mail-archive.js b/src/Resources/public/administration/js/frosh-platform-mail-archive.js new file mode 100755 index 0000000..b2d19ec --- /dev/null +++ b/src/Resources/public/administration/js/frosh-platform-mail-archive.js @@ -0,0 +1,284 @@ +(()=>{var c=Shopware.Classes.ApiService,h=class extends c{constructor(t,s,a="frosh-mail-archive"){super(t,s,a)}resendMail(t){let s=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/resend-mail`,{mailId:t},{...this.basicConfig,headers:s}).then(a=>c.handleResponse(a))}downloadMail(t){let s=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/content`,{mailId:t},{...this.basicConfig,headers:s}).then(a=>{let i=c.handleResponse(a);if(!i.success)return i;let r=window.URL.createObjectURL(new Blob([i.content])),l=document.createElement("a");l.href=r,l.setAttribute("download",i.fileName),document.body.appendChild(l),l.click()})}downloadAttachment(t){let s=this.getBasicHeaders({});return this.httpClient.post(`_action/${this.getApiBasePath()}/attachment`,{attachmentId:t},{...this.basicConfig,headers:s}).then(a=>{let i=c.handleResponse(a);if(!i.success)return i;let r=document.createElement("a");r.href="data:"+i.contentType+";base64,"+i.content,r.setAttribute("download",i.fileName),document.body.appendChild(r),r.click()})}},d=h;var{Application:m}=Shopware;m.addServiceProvider("froshMailArchiveService",e=>{let t=m.getContainer("init");return new d(t.httpClient,e.loginService)});var u=` + + + + + + +`;var{Component:w,Mixin:p}=Shopware,{Criteria:o}=Shopware.Data,b=Shopware.Utils;w.register("frosh-mail-archive-index",{template:u,inject:["repositoryFactory","froshMailArchiveService"],mixins:[p.getByName("listing"),p.getByName("notification")],metaInfo(){return{title:this.$createTitle()}},data(){return{page:1,limit:25,total:0,repository:null,items:null,isLoading:!0,filter:{salesChannelId:null,transportState:null,customerId:null,term:null},selectedItems:{}}},computed:{columns(){return[{property:"createdAt",dataIndex:"createdAt",label:"frosh-mail-archive.list.columns.sentDate",primary:!0,routerLink:"frosh.mail.archive.detail"},{property:"transportState",dataIndex:"transportState",label:"frosh-mail-archive.list.columns.transportState",allowResize:!0},{property:"subject",dataIndex:"subject",label:"frosh-mail-archive.list.columns.subject",allowResize:!0,routerLink:"frosh.mail.archive.detail"},{property:"receiver",dataIndex:"receiver",label:"frosh-mail-archive.list.columns.receiver",allowResize:!0}]},mailArchiveRepository(){return this.repositoryFactory.create("frosh_mail_archive")},date(){return Shopware.Filter.getByName("date")},transportStateOptions(){return[{value:"failed",label:this.translateState("failed")},{value:"sent",label:this.translateState("sent")},{value:"pending",label:this.translateState("pending")}]}},methods:{translateState(e){return this.$tc(`frosh-mail-archive.state.${e}`)},getList(){this.isLoading=!0;let e=new o(this.page,this.limit);return e.setTerm(this.term),this.filter.transportState&&e.addFilter(o.equals("transportState",this.filter.transportState)),this.filter.salesChannelId&&e.addFilter(o.equals("salesChannelId",this.filter.salesChannelId)),this.filter.customerId&&e.addFilter(o.equals("customerId",this.filter.customerId)),this.filter.term&&e.setTerm(this.filter.term),e.addSorting(o.sort("createdAt","DESC")),this.mailArchiveRepository.search(e,Shopware.Context.api).then(t=>{this.items=t,this.total=t.total,this.isLoading=!1})},resendMail(e){this.isLoading=!0,this.froshMailArchiveService.resendMail(e.id).then(async()=>{this.createNotificationSuccess({title:this.$tc("frosh-mail-archive.detail.resend-success-notification.title"),message:this.$tc("frosh-mail-archive.detail.resend-success-notification.message")}),await this.getList()}).catch(()=>{this.createNotificationError({title:this.$tc("frosh-mail-archive.detail.resend-error-notification.title"),message:this.$tc("frosh-mail-archive.detail.resend-error-notification.message")})}).finally(()=>{this.isLoading=!1})},onBulkResendClick(){let e=Object.keys(this.selectedItems);e.length!==0&&(this.isLoading=!0,Promise.all(e.map(t=>this.froshMailArchiveService.resendMail(t))).finally(async()=>{this.$refs.table?.resetSelection(),await this.getList(),this.isLoading=!1}))},onSelectionChanged(e){this.selectedItems=e},resetFilter(){this.filter={salesChannelId:null,customerId:null,term:null}}},watch:{filter:{deep:!0,handler:b.debounce(function(){this.getList()},400)}}});var f=` + + + + + + +`;var{Component:y,Mixin:x}=Shopware,{Criteria:$}=Shopware.Data;y.register("frosh-mail-archive-detail",{template:f,inject:["repositoryFactory","froshMailArchiveService"],data(){return{archive:null,resendIsLoading:!1,resendIsSuccessful:!1,downloadIsLoading:!1,downloadIsSuccessful:!1,resendCounter:0}},props:{archiveId:{type:String,required:!0}},mixins:[x.getByName("notification")],created(){this.loadMail()},watch:{archiveId(){this.loadMail()}},computed:{resendKey(){return this.archive.id+this.resendCounter},repository(){return this.repositoryFactory.create("frosh_mail_archive")},createdAtDate(){let e=Shopware.State.getters.adminLocaleLanguage||"en",t={day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"};return new Intl.DateTimeFormat(e,t).format(new Date(this.archive.createdAt))},receiverText(){let e=[];return Object.keys(this.archive.receiver).forEach(t=>{e.push(`${this.archive.receiver[t]} <${t}>`)}),e.join(",")},senderText(){let e=[];return Object.keys(this.archive.sender).forEach(t=>{e.push(`${this.archive.sender[t]} <${t}>`)}),e.join(",")},htmlText(){return this.getContent(this.archive.htmlText)},plainText(){return this.getContent(this.archive.plainText)},attachmentsColumns(){return[{property:"fileName",label:this.$t("frosh-mail-archive.detail.attachments.file-name"),rawData:!0},{property:"fileSize",label:this.$t("frosh-mail-archive.detail.attachments.size"),rawData:!0},{property:"contentType",label:this.$t("frosh-mail-archive.detail.attachments.type"),rawData:!0}]}},methods:{loadMail(){let e=new $;e.addAssociation("attachments"),this.repository.get(this.archiveId,Shopware.Context.api,e).then(t=>{this.archive=t})},getContent(e){return"data:text/html;base64,"+btoa(unescape(encodeURIComponent(e.replace(/[\u00A0-\u2666]/g,function(t){return"&#"+t.charCodeAt(0)+";"}))))},openCustomer(){this.$router.push({name:"sw.customer.detail",params:{id:this.archive.customer.id}})},resendFinish(){this.resendIsSuccessful=!1},downloadFinish(){this.downloadIsSuccessful=!1},resendMail(){this.resendIsLoading=!0,this.froshMailArchiveService.resendMail(this.archive.id).then(()=>{this.resendIsSuccessful=!0,this.createNotificationSuccess({title:this.$tc("frosh-mail-archive.detail.resend-success-notification.title"),message:this.$tc("frosh-mail-archive.detail.resend-success-notification.message")})}).catch(()=>{this.resendIsSuccessful=!1,this.createNotificationError({title:this.$tc("frosh-mail-archive.detail.resend-error-notification.title"),message:this.$tc("frosh-mail-archive.detail.resend-error-notification.message")})}).finally(()=>{this.resendIsLoading=!1,this.resendCounter++})},downloadMail(){this.downloadIsLoading=!0,this.froshMailArchiveService.downloadMail(this.archive.id).then(()=>{this.downloadIsSuccessful=!0}).catch(()=>{this.downloadIsSuccessful=!1}).finally(()=>{this.downloadIsLoading=!1})},downloadAttachment(e){this.froshMailArchiveService.downloadAttachment(e)},formatSize(e){let a=e;if(Math.abs(e)<1024)return e+" B";let i=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],r=-1,l=10**1;do a/=1024,++r;while(Math.round(Math.abs(a)*l)/l>=1024&&r + + +`;var{Criteria:n}=Shopware.Data;Shopware.Component.register("frosh-mail-resend-history",{props:{sourceMailId:{required:!0,type:String},currentMailId:{required:!0,type:String}},template:v,data(){return{resentMails:[],isLoading:!1,columns:[{property:"createdAt",label:this.$tc("frosh-mail-archive.detail.resend-grid.column-created-at"),primary:!0},{property:"success",label:this.$tc("frosh-mail-archive.detail.resend-grid.column-state"),sortable:!1}]}},inject:["repositoryFactory"],computed:{mailArchiveRepository(){return this.repositoryFactory.create("frosh_mail_archive")},date(){return Shopware.Filter.getByName("date")}},async created(){this.isLoading=!0,await this.loadMails(),this.isLoading=!1},methods:{translateState(e){return this.$tc(`frosh-mail-archive.state.${e}`)},async loadMails(){let e=new n;e.addFilter(n.multi("OR",[n.equals("id",this.sourceMailId),n.equals("sourceMailId",this.sourceMailId)])),e.addSorting(n.sort("createdAt","DESC")),this.resentMails=await this.mailArchiveRepository.search(e,Shopware.Context.api)},navigateToDetailPage(e){this.$router.push({name:"frosh.mail.archive.detail",params:{id:e}})}}});Shopware.Module.register("frosh-mail-archive",{type:"plugin",name:"frosh-mail-archive.title",title:"frosh-mail-archive.title",description:"",color:"#243758",icon:"regular-envelope",entity:"frosh_mail_archive",routes:{list:{component:"frosh-mail-archive-index",path:"list",meta:{privilege:"frosh_mail_archive:read"}},detail:{component:"frosh-mail-archive-detail",path:"detail/:id",meta:{parentPath:"frosh.mail.archive.list",privilege:"frosh_mail_archive:read"},props:{default:e=>({archiveId:e.params.id})}}},settingsItem:[{group:"plugins",to:"frosh.mail.archive.list",icon:"regular-envelope",name:"frosh-mail-archive.title",privilege:"frosh_mail_archive:read"}]});})(); diff --git a/src/Resources/store/de.md b/src/Resources/store/de.md deleted file mode 100644 index 0acdad3..0000000 --- a/src/Resources/store/de.md +++ /dev/null @@ -1,8 +0,0 @@ -Mit diesem Plugin erhalten Sie ein einfaches durchsuchbares Archiv für E-Mails, die aus Shopware versendet werden. -Die E-Mails sind über den Menüpfad erreichbar: Einstellungen/Erweiterungen/Main Archiv. - -Dieses Plugin wird von [@FriendsOfShopware](https://store.shopware.com/friends-of-shopware.html) -entwickelt. -Maintainer dieses Plugins ist: [Soner Sayakci](https://github.com/shyim) - -Bei Fragen / Fehlern bitte ein [Github Issue](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/issues/new) erstellen diff --git a/src/Resources/store/en.md b/src/Resources/store/en.md deleted file mode 100644 index 293d8c5..0000000 --- a/src/Resources/store/en.md +++ /dev/null @@ -1,7 +0,0 @@ -With this plugin you get a simple searchable archive for emails that are sent from Shopware. -The e-mails can be found via the menu path Settings/Extensions/Main Archive. - -This plugin is part of [@FriendsOfShopware](https://store.shopware.com/en/friends-of-shopware.html). -Maintainer from the plugin is: [Soner Sayakci](https://github.com/shyim) - -For questions or bugs please create a [Github Issue](https://github.com/FriendsOfShopware/FroshPlatformMailArchive/issues/new) diff --git a/src/Resources/store/icon.png b/src/Resources/store/icon.png deleted file mode 100644 index 885856b..0000000 Binary files a/src/Resources/store/icon.png and /dev/null differ diff --git a/src/Resources/store/images/1.png b/src/Resources/store/images/1.png deleted file mode 100644 index 4d8aa2f..0000000 Binary files a/src/Resources/store/images/1.png and /dev/null differ diff --git a/src/Resources/store/images/2.png b/src/Resources/store/images/2.png deleted file mode 100644 index b463f64..0000000 Binary files a/src/Resources/store/images/2.png and /dev/null differ diff --git a/src/Resources/store/img-0.png b/src/Resources/store/img-0.png deleted file mode 100755 index 4d8aa2f..0000000 Binary files a/src/Resources/store/img-0.png and /dev/null differ diff --git a/src/Resources/store/img-1.png b/src/Resources/store/img-1.png deleted file mode 100755 index b463f64..0000000 Binary files a/src/Resources/store/img-1.png and /dev/null differ diff --git a/src/Resources/store/store.json b/src/Resources/store/store.json deleted file mode 100644 index c88bf65..0000000 --- a/src/Resources/store/store.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "storeAvailabilities": [ - "International", - "German" - ], - "standardLocale": "en_GB", - "localizations": ["de_DE","en_GB","fr_FR","nl_NL","es_ES","it_IT"], - "categories": ["BackendBearbeitung"], - "productType": "extension", - "responsive": true, - "tags": { - "en": [ - "mail", - "archive" - ], - "de": [ - "mail", - "archive" - ] - } -}