2026-02-28 18:57:51 +00:00
|
|
|
defmodule BerrypodWeb.ContactController do
|
|
|
|
|
use BerrypodWeb, :controller
|
|
|
|
|
|
|
|
|
|
alias Berrypod.ContactNotifier
|
|
|
|
|
|
2026-03-08 08:58:43 +00:00
|
|
|
plug BerrypodWeb.Plugs.RateLimit, [type: :api] when action == :create
|
|
|
|
|
|
2026-02-28 18:57:51 +00:00
|
|
|
@doc """
|
|
|
|
|
Handles contact form submission (no-JS fallback).
|
|
|
|
|
"""
|
|
|
|
|
def create(conn, params) do
|
|
|
|
|
case ContactNotifier.deliver_contact_message(params) do
|
|
|
|
|
{:ok, _} ->
|
|
|
|
|
conn
|
|
|
|
|
|> put_flash(:info, "Message sent! We'll get back to you soon.")
|
integrate R module and add url editor ui
Replaces hardcoded paths with R module throughout:
- Shop components: layout nav, cart, product links
- Controllers: cart, checkout, contact, seo, order lookup
- Shop pages: collection, product, search, checkout success, etc.
- Site context: nav item url resolution
Admin URL management:
- Settings page: prefix editor with validation feedback
- Page renderer: url_editor component for page URLs
- CSS for url editor styling
Test updates for cache isolation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 00:36:17 +01:00
|
|
|
|> redirect(to: R.contact())
|
2026-02-28 18:57:51 +00:00
|
|
|
|
|
|
|
|
{:error, :invalid_params} ->
|
|
|
|
|
conn
|
|
|
|
|
|> put_flash(:error, "Please fill in all required fields.")
|
integrate R module and add url editor ui
Replaces hardcoded paths with R module throughout:
- Shop components: layout nav, cart, product links
- Controllers: cart, checkout, contact, seo, order lookup
- Shop pages: collection, product, search, checkout success, etc.
- Site context: nav item url resolution
Admin URL management:
- Settings page: prefix editor with validation feedback
- Page renderer: url_editor component for page URLs
- CSS for url editor styling
Test updates for cache isolation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 00:36:17 +01:00
|
|
|
|> redirect(to: R.contact())
|
2026-02-28 18:57:51 +00:00
|
|
|
|
|
|
|
|
{:error, _} ->
|
|
|
|
|
conn
|
|
|
|
|
|> put_flash(:error, "Sorry, something went wrong. Please try again.")
|
integrate R module and add url editor ui
Replaces hardcoded paths with R module throughout:
- Shop components: layout nav, cart, product links
- Controllers: cart, checkout, contact, seo, order lookup
- Shop pages: collection, product, search, checkout success, etc.
- Site context: nav item url resolution
Admin URL management:
- Settings page: prefix editor with validation feedback
- Page renderer: url_editor component for page URLs
- CSS for url editor styling
Test updates for cache isolation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-01 00:36:17 +01:00
|
|
|
|> redirect(to: R.contact())
|
2026-02-28 18:57:51 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|