MapComplete/src/UI/Popup/SendEmail.svelte

21 lines
724 B
Svelte
Raw Normal View History

<script lang="ts">
2023-09-21 15:29:34 +02:00
import type { OsmTags } from "../../Models/OsmFeature"
import Svg from "../../Svg"
import ToSvelte from "../Base/ToSvelte.svelte"
import { Utils } from "../../Utils"
2023-12-29 22:46:02 +01:00
import { Store } from "../../Logic/UIEventSource"
import Envelope from "../../assets/svg/Envelope.svelte"
export let tags: Store<OsmTags>
export let args: string[]
2023-09-21 15:29:34 +02:00
let [to, subject, body, button_text] = args.map((a) => Utils.SubstituteKeys(a, $tags))
let url =
"mailto:" + to + "?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body)
</script>
2023-09-21 15:29:34 +02:00
2023-12-29 22:46:02 +01:00
<a class="button flex w-full items-center" href={url} style="margin-left: 0">
2024-02-20 13:33:38 +01:00
<Envelope class="mr-4 h-8 w-8 shrink-0" />
{button_text}
</a>