refactor: mail content 번역 시에도 원본 데이터 전달되도록 수정

This commit is contained in:
Daseul Kim 2025-06-27 12:57:25 +09:00
parent d63cc4709a
commit eed3cd59e3

View File

@ -139,7 +139,7 @@ export default function SurveySaleSubmitPopup() {
to: submitData.receiver,
cc: submitData.reference ?? '',
subject: submitData.title,
content: contentsRef.current?.innerHTML ?? '',
content: generateEmailContent(),
})
.then(() => {
if (!isSubmittingSurvey) {
@ -160,7 +160,38 @@ export default function SurveySaleSubmitPopup() {
}
}
const contentsRef = useRef<HTMLDivElement>(null)
const generateEmailContent = () => `
<div>
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 15px;">
HANASYS現地調査アプリを使用した現地調査結果が送信されました
</p>
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 3px;">
- <span style="color: #417DDC;">${surveyDetail?.representative}</span>
</p>
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 3px;">
-
<span style="color: #417DDC;">
${surveyDetail?.store} (${surveyDetail?.storeId})
</span>
</p>
<p style="font-size: 13px; font-weight: 400; color: #2e3a59; margin-bottom: 15px;">
-:
<span style="color: #417DDC;">${surveyDetail?.constructionPoint}</span>
</p>
<p>
<a
style="font-size: 13px; font-weight: 400; color: #1259CB; margin-bottom: 5px; text-decoration: underline;"
href="${process.env.NEXT_PUBLIC_API_URL}/pdf/survey-sale/${surveyDetail?.id}"
target="_blank"
>
調PDFダウンロード
</a>
</p>
<p style="font-size: 13px; font-weight: 400; color: #2e3a59;">
調PDFをダウンロードできます
</p>
</div>
`
const handleClose = () => {
popupController.setSurveySaleSubmitPopup(false)
@ -185,36 +216,7 @@ export default function SurveySaleSubmitPopup() {
<div className="data-input">
{field.id === 'contents' ? (
<div className="submit-content" id={field.id}>
<div ref={contentsRef}>
<p style={{ fontSize: '13px', fontWeight: '400', color: '#2e3a59', marginBottom: '15px' }}>
HANASYS現地調査アプリを使用した現地調査結果が送信されました
</p>
<p style={{ fontSize: '13px', fontWeight: '400', color: '#2e3a59', marginBottom: '3px' }}>
- <span style={{ color: '#417DDC' }}>{surveyDetail?.representative}</span>
</p>
<p style={{ fontSize: '13px', fontWeight: '400', color: '#2e3a59', marginBottom: '3px' }}>
-
<span style={{ color: '#417DDC' }}>
{surveyDetail?.store} ({surveyDetail?.storeId})
</span>
</p>
<p style={{ fontSize: '13px', fontWeight: '400', color: '#2e3a59', marginBottom: '15px' }}>
-:
<span style={{ color: '#417DDC' }}>{surveyDetail?.constructionPoint}</span>
</p>
<p>
<a
style={{ fontSize: '13px', fontWeight: '400', color: '#1259CB', marginBottom: '5px', textDecoration: 'underline' }}
href={`${process.env.NEXT_PUBLIC_API_URL}/pdf/survey-sale/${surveyDetail?.id}`}
target="_blank"
>
調PDFダウンロード
</a>
</p>
<p style={{ fontSize: '13px', fontWeight: '400', color: '#2e3a59' }}>
調PDFをダウンロードできます
</p>
</div>
<div dangerouslySetInnerHTML={{ __html: generateEmailContent() }} />
</div>
) : (
<>