Le campagne rispettano orario e giorni lavorativi, richiedono una mail di test con dati inseriti a mano prima dell'invio massivo e offrono una dashboard per monitorare l'avanzamento. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
633 B
JavaScript
29 lines
633 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
static targets = ["frame"]
|
|
static values = { previewUrl: String }
|
|
|
|
connect() {
|
|
this.loadPreview()
|
|
}
|
|
|
|
preview() {
|
|
clearTimeout(this.timer)
|
|
this.timer = setTimeout(() => this.loadPreview(), 350)
|
|
}
|
|
|
|
loadPreview() {
|
|
if (!this.hasFrameTarget) return
|
|
|
|
const params = new URLSearchParams(new FormData(this.element))
|
|
params.delete("authenticity_token")
|
|
params.delete("commit")
|
|
this.frameTarget.src = `${this.previewUrlValue}?${params.toString()}`
|
|
}
|
|
|
|
disconnect() {
|
|
clearTimeout(this.timer)
|
|
}
|
|
}
|