25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

29 satır
1.1KB

  1. param(
  2. [Parameter(Mandatory = $true)][string]$RequestPath,
  3. [string]$ConfigPath = (Join-Path (Split-Path -Parent $PSScriptRoot) 'config.ini'),
  4. [string]$OutputRoot
  5. )
  6. $ErrorActionPreference = 'Stop'
  7. . (Join-Path $PSScriptRoot 'campaign-common.ps1')
  8. if (-not $OutputRoot) { $OutputRoot = Join-Path (Split-Path -Parent $ConfigPath) 'temp\previews' }
  9. $context = Get-MailContext -ConfigPath $ConfigPath
  10. $request = Read-CampaignRequest $RequestPath
  11. $db = Open-MailDatabase $context
  12. try {
  13. $review = Get-CampaignReview $context $request $db
  14. $previewPath = Write-CampaignPreview $review $OutputRoot
  15. [pscustomobject]@{
  16. Count = $review.Contacts.Count
  17. Token = $review.Token
  18. PreviewPath = $previewPath
  19. TemplateName = $review.TemplateName
  20. TemplateVersion = $review.TemplateVersion
  21. From = $review.Identity.From
  22. ReplyTo = $review.Identity.ReplyTo
  23. TestTo = $review.Identity.TestTo
  24. PostalAddress = $review.Identity.Postal
  25. Subject = $review.Subject
  26. } | ConvertTo-Json -Compress
  27. }
  28. finally { $db.Dispose() }

Powered by TurnKey Linux.