Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<%= form_with model: mail_identity, class: "space-y-6 rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100 p-6" do |f| %>
|
||||
<%= render "shared/errors", object: mail_identity %>
|
||||
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
<div class="md:col-span-2">
|
||||
<label class="mb-1 block text-sm font-medium">Nome account</label>
|
||||
<%= f.text_field :name, required: true, placeholder: "MatchLiveTV produzione", class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Nome mittente</label>
|
||||
<%= f.text_field :from_name, required: true, placeholder: "MatchLiveTV", class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Email mittente</label>
|
||||
<%= f.email_field :from_email, required: true, placeholder: "hello@example.com", class: input_class %>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<label class="mb-1 block text-sm font-medium">Reply-To (opzionale)</label>
|
||||
<%= f.email_field :reply_to, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Host SMTP</label>
|
||||
<%= f.text_field :smtp_host, required: true, placeholder: "smtp.example.com", class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Porta</label>
|
||||
<%= f.number_field :smtp_port, required: true, min: 1, max: 65535, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Crittografia</label>
|
||||
<%= f.select :encryption, Catalog::MAIL_ENCRYPTIONS.map { |k, v| [v, k] }, {}, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Autenticazione</label>
|
||||
<%= f.select :smtp_authentication, Catalog::MAIL_AUTH_METHODS.map { |k, v| [v, k] }, {}, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Utente SMTP</label>
|
||||
<%= f.text_field :smtp_username, autocomplete: "off", class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Password SMTP<%= " (lascia vuoto per non cambiare)" unless mail_identity.new_record? %></label>
|
||||
<%= f.password_field :smtp_password, autocomplete: "new-password", class: input_class %>
|
||||
</div>
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<%= f.check_box :verify_ssl %>
|
||||
Verifica il certificato SSL del server
|
||||
</label>
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<%= f.check_box :active %>
|
||||
Account attivo
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2 border-t border-zinc-100 pt-4 dark:border-zinc-800">
|
||||
<%= f.submit mail_identity.new_record? ? "Crea account" : "Salva", class: btn_primary %>
|
||||
<%= link_to "Annulla", mail_identities_path, class: btn_secondary %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless mail_identity.new_record? %>
|
||||
<div class="mt-4">
|
||||
<%= button_to "Elimina account", mail_identity_path(mail_identity), method: :delete,
|
||||
class: btn_danger,
|
||||
form: { data: { turbo_confirm: "Eliminare #{mail_identity.name}?" } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="mx-auto max-w-2xl space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Modifica account email</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500"><%= @mail_identity.from_email %></p>
|
||||
</div>
|
||||
|
||||
<%= render "form", mail_identity: @mail_identity %>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<div class="space-y-6">
|
||||
<div class="flex flex-wrap items-end justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Account email / SMTP</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500">
|
||||
<%= link_to "Impostazioni", admin_path, class: "hover:underline" %>
|
||||
· da questi indirizzi partono le campagne. Le password SMTP sono cifrate.
|
||||
</p>
|
||||
</div>
|
||||
<%= link_to "Nuovo account", new_mail_identity_path, class: btn_primary %>
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden <%= card_class %>">
|
||||
<% if @mail_identities.empty? %>
|
||||
<p class="p-6 text-sm text-zinc-500">Nessun account. Crea il mittente con host, porta e credenziali SMTP.</p>
|
||||
<% else %>
|
||||
<table class="<%= table_class %>">
|
||||
<thead class="border-b border-zinc-100 bg-zinc-50 text-left text-xs font-medium uppercase tracking-wide text-zinc-500 dark:border-zinc-800 dark:bg-zinc-800 dark:text-zinc-400">
|
||||
<tr>
|
||||
<th class="px-4 py-3">Nome</th>
|
||||
<th class="px-4 py-3">Mittente</th>
|
||||
<th class="px-4 py-3">SMTP</th>
|
||||
<th class="px-4 py-3">Stato</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
|
||||
<% @mail_identities.each do |identity| %>
|
||||
<tr class="<%= "opacity-60" unless identity.active? %>">
|
||||
<td class="px-4 py-3 font-medium"><%= identity.name %></td>
|
||||
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">
|
||||
<%= identity.from_name %><br>
|
||||
<span class="text-xs"><%= identity.from_email %></span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300">
|
||||
<%= identity.smtp_host %>:<%= identity.smtp_port %>
|
||||
<div class="text-xs text-zinc-500"><%= Catalog.label_for(Catalog::MAIL_ENCRYPTIONS, identity.encryption) %></div>
|
||||
</td>
|
||||
<td class="px-4 py-3"><%= identity.active? ? "Attivo" : "Disattivo" %></td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<%= link_to "Modifica", edit_mail_identity_path(identity), class: "text-zinc-700 hover:underline dark:text-zinc-300" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="mx-auto max-w-2xl space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Nuovo account email</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500">Indirizzo mittente e impostazioni SMTP da cui partiranno gli invii.</p>
|
||||
</div>
|
||||
|
||||
<%= render "form", mail_identity: @mail_identity %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user